In the attached project, I am using a popup dialog to manage maintenance of rows in a repeat structure. One page contains the popup dialog and the "add" button and loads a partial page which displays the existing rows of the repeating structure. The rows contain an "Edit" button which display the dialog after loading it with the values from the chosen row. The "add" button displays the dialog with empty fields.
The "save" button of the dialog calls the partial page with the table which performs the add/update operation then reloads the table with the updates.
Currently the update operation works fine, but when I try to add a new row, all of the dialog fields show up in the "unbound" section of the document passed to the partial page that contains the table while the record structure the dialog fields are bound to are empty.
What are the circumstances where webmaker creates the "unbound" section? It seems that the only difference between the 2 cases is where the initial event is fired from (table partial page or parent partial page).
I am using webmaker 5 and the page in question is APD_DPSect3. I have used the exact same table management approach in other pages of this project without any problems...(APD_sect1, APD_sect5)
The "save" button of the dialog calls the partial page with the table which performs the add/update operation then reloads the table with the updates.
Currently the update operation works fine, but when I try to add a new row, all of the dialog fields show up in the "unbound" section of the document passed to the partial page that contains the table while the record structure the dialog fields are bound to are empty.
What are the circumstances where webmaker creates the "unbound" section? It seems that the only difference between the 2 cases is where the initial event is fired from (table partial page or parent partial page).
I am using webmaker 5 and the page in question is APD_DPSect3. I have used the exact same table management approach in other pages of this project without any problems...(APD_sect1, APD_sect5)
Attachment
RE: why are my form elements (sometimes) unbound
I have had a look at the project you have provided, and I think I am able to replicate the issue you are seeing.
I think the problem is being caused by the reset container action being performed on click of the +?+?++Add+?+?-?+?+?+? button on the APD_DPSect3 page. You have this set to the +?+?++Clear+?+?+? mode which makes sense as this should remove all the values from the fields in the group.
Unfortunately, it looks like this is also incorrectly clearing some hidden fields needed for the binding process, leading to the unbound state you are seeing.
I think if you change this action to use the +?+?++Reset+?+?+? mode instead then it won+?+?+?t clear out this hidden information and so will perform much better. From what I can see, the fields in your popup initially seem to be blank anyway, so resetting them to their initial values should hopefully be equivalent to clearing them. If you need to do any additional clearout work you could always add some custom script code to achieve this.
I+?+?+?m sorry you have encountered this problem. We will look in to this further to try and resolve the clear problem, but in the meantime hopefully this will enable you to get your app working correctly.
Let me know if you have any further questions.
Regards,
Gerard
RE: why are my form elements (sometimes) unbound
I assume that the hidden fields you referred to are webmaker fields outside of my control. Should I assume this problem may occur any time a "clear" reset is called?
RE: why are my form elements (sometimes) unbound
Yes these fields are automatically generated based on the contents of the page so you cant really control them. (Although they are standard hidden fields so can be accessed with script etc)
It may not be the case, but it is probably safest to assume for now that using the 'clear' option will cause an issue. I'll let you know when I have any more info.
Regards,
Gerard
RE: why are my form elements (sometimes) unbound
RE: why are my form elements (sometimes) unbound
This refers to an option on the built in event "reset fields in container". You can choose "clear" or "reset"
The clear option was definitely causing a problem with bindings in a pop up dialog in version 5. I haven't retried it in version 6. For my issue "reset" worked fine since the dialog fields are always blank when the page is loaded.
RE: why are my form elements (sometimes) unbound
If you have not yet upgraded to this version then unfortunately you would still need to use the alternative approach.
Regards,
Gerard