I am trying to take a value from a drop down select box and use it as a variable to lookup a second value and then submit both values to my database. I was able to sucessfully make an Ajax call based off the value from my main page drop down which returns the correct expected value however, I do not know how to set the partial page value back on the main page so I can use it (meaning it displays but it is not written to the main page xml document). I am sure there is a simple solution that I am missing.
RE: How to set the value from an Ajax call on main page
When you make a call to a partial page you can choose where (in which group) on the main page the details from the partial page will be displayed.
If you only want to display your second value on the page, then just place it in an output field on the partial page, and it will be visible, but will not be submitted to the server.
If you do want to submit the value (which I think you do) then place it in an editable control (eg text box, select, hidden, etc) on the partial page. Once the partial page fields are included in the main page they can be submitted with the rest of the data on the page.
In order for this to work correctly, there are a couple of things you may need to check.
Firstly, on the main page, go to the Data Bindings screen and select the Action Submission Bindings tab. Then select the accordion entry for the action that you wish all the data to be submitted to. Now make sure that the document displayed on the right contains an element for every piece of data you want to submit (including for the values from the partial page). If not, you can edit this document as needed by clicking the link at the top of the document tree.
The second step is to go to the Data Bindings screen for your partial page, and select the editable field that holds your second value. Now select the Action Submission Bindings tab and open up the accordion for the relevant action from your main page. Now make sure that the Field Submission Binding is correctly mapped to the right element in the document.
If these areas all look ok, then you can generate and deploy the application, and you should find that the values from the partial page should be submitted and bound into the XML data together with the fields from the main page.
I hope this helps. Please let me know if you are still having problems.
Gerard
RE: How to set the value from an Ajax call on main page
The main thing I was missing was creating a second field on my partial page to store the value from my dynamic lookup. Once I set the value, I was able to bind the data and submit with no problems. Again thanks!
RE: How to set the value from an Ajax call on main page
Answered by myself. You have to add and OnLoad event Ajax Submission with the required parameters, the only catch is that it has to be the first event.