I've come across something strange today with regards to calling loading a partial page from a different project.
The complete form data was submitted and following the logs it was possible to see the structure go though similar to this
<mvc:eForm>
<mvc:control>
somestufff
</mvc:control>
<mvc:data>
<mvc:formData>
<field1>mytestdata</field1>
</mvc:formData>
</mvc:data>
</mvc:eForm>
The partial page did a few things based on this data and everything was fine until another controller was added off the main form.
What I saw then was the XML structure coming into the partial page lose tags and the structure looks similar to
<mvc:eForm>
<mvc:control>
<field1>mytestdata</field1>
</mvc:control>
<mvc:data/>
</mvc:eForm>
Which then caused all manor of issue in the partial page as the structure was not the same.
Why would this happen or more to the point should it?
The complete form data was submitted and following the logs it was possible to see the structure go though similar to this
<mvc:eForm>
<mvc:control>
somestufff
</mvc:control>
<mvc:data>
<mvc:formData>
<field1>mytestdata</field1>
</mvc:formData>
</mvc:data>
</mvc:eForm>
The partial page did a few things based on this data and everything was fine until another controller was added off the main form.
What I saw then was the XML structure coming into the partial page lose tags and the structure looks similar to
<mvc:eForm>
<mvc:control>
<field1>mytestdata</field1>
</mvc:control>
<mvc:data/>
</mvc:eForm>
Which then caused all manor of issue in the partial page as the structure was not the same.
Why would this happen or more to the point should it?
RE: Partial Page AJAX calls change behaviour
Hopefully the following will explain what you are seeing.
When you are editing the bindings for a page, you are able to provide different bindings, and use completely different structures for each action that applies to the page.
WebMaker uses the application map layout for your project to determine which actions you are able to provide bindings for on a given page. WebMaker does not know about the actions you are calling in a different project (eg to load in a partial page from that project) and so you will not see a binding accordion pane for that action.
When the page is generated, it checks all the different bindings specified for each field to look for differences between the actions. If the bindings are the same across the actions, then this binding will be configured to apply to all actions (including those that WebMaker does not know about explicitly, eg in another project).
If some of the actions have a different binding, then each binding will be linked specifically to the actions it applies to. In this case, actions that WebMaker does not know about will not have any binding information at all.
The same processing applies to the action binding fragments that specify the structure of the XML data that the fields can bind to.
In your scenario, I assume you initially had only one action coming from your main page (in that project), and so the bindings you specified for this action would apply to all actions, including those in another project.
By adding a new controller you now have two actions from your page, which probably contain different bindings. As a result the binding information will now apply to specific actions, and so your call to the partial page in the second project won+?+?+?t have any bindings applied.
When there is no binding information applied, all the values submitted will just appear in the control section of the message.
To resolve this, your best option is to make sure the bindings for each action from your main page are the same. The easiest way to do this is to use the +?+?++set bindings based on another action+?+?+? option in the action configuration settings.
If you are using WebMaker v3.x then you will also need to ensure that the action structure documents are the same for each action as well. If using version 4 this will be handled automatically.
While this behaviour is not ideal, I hope the above makes sense, and helps to explain what you are seeing.
Let me know if you have any more questions on this.
Regards,
Gerard