Announcement Announcement Module
Collapse
No announcement yet.
Design issue (POJO and DTO/VO) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Colin,

    All my collections are initialised to an empty collection which I guess is my problem in a way. The application flow is as follows:

    1. The user calls a simple controller to retrieve alarm #1. The alarm is retrieved and an XMLBuilder walks the object graph producing some xml like:

    <Alarm id='1' name='foo' description='bar' alarmPriorityId='2'>
    <action id='1' name='foo'/>
    <action id='2' name='bar'/>
    </Alarm>

    2. This xml is sent to the Laszlo client which displays it in a form. The user edits the alarm name in the Laszlo form and hits submit.

    3. This calls a (different) formController to execute a save action. The parameters of the httpRequest sent only contain the Alarm details and none of the action details. The form controller doesn't know which alarm is to be updated until it receives the request and can read the id field. There is also nothing to pass to a CustomCollectionEditor at this point.

    Are you saying that I can override the formBackingObject so that it waits until the request is received, plucks out the id field and then retrieves a specific Alarm from the database to use as the backing object ? This would ensure that the 'actions' collection contained action #1 and action #2 whereas without this functionality the backing object would be a new Alarm with an actions collection which contains no items.

    Thanks for your help on this BTW.

    Comment


    • #17
      Originally posted by dcoales
      Are you saying that I can override the formBackingObject so that it waits until the request is received, plucks out the id field and then retrieves a specific Alarm from the database to use as the backing object ? This would ensure that the 'actions' collection contained action #1 and action #2 whereas without this functionality the backing object would be a new Alarm with an actions collection which contains no items.
      Exactly.

      Check out the javadoc for SimpleFormController (and its super classes).

      Essentially formbackingObject is called to load the persistent domain object and then the values are introspected, validation is called and if everything is peachy, onSubmit is eventually called.

      I have absolutely *no* experience with Laszo so you are own your own with that

      Comment

      Working...
      X