OK. I'm banging my head on this. I have a Select Box field with dynamic values based on a dept id table select. The whole table is pulled into the xml. The value/display are the first 2 fields, DEPTID and DESCR.
Now, what I want to do is update a hidden field with the DESCR field to post to the database (actually 3 fields, but let's keep it simple). I'm trying a onchange set value based on server data (again, the whole table is in the xml) but I cannot get the selected value. I can put a hard coded value in the xpath and it works. How do I get the current select value into my xpath?
xpaths I put into the "Value to set for field.." :
this works---
/mvc:eForm/mvc :D ata/PS_FR_DEPT_TBL/record[DEPTID='41406']/DESCR
this doesn't work----
/mvc:eForm/mvc :D ata/PS_FR_DEPT_TBL/record[DEPTID=/mvc:eForm/mvc :D ata/EF_TRAVEL_CLAIM/record/DEPTID]/DESCR
Thanks!
Now, what I want to do is update a hidden field with the DESCR field to post to the database (actually 3 fields, but let's keep it simple). I'm trying a onchange set value based on server data (again, the whole table is in the xml) but I cannot get the selected value. I can put a hard coded value in the xpath and it works. How do I get the current select value into my xpath?
xpaths I put into the "Value to set for field.." :
this works---
/mvc:eForm/mvc :D ata/PS_FR_DEPT_TBL/record[DEPTID='41406']/DESCR
this doesn't work----
/mvc:eForm/mvc :D ata/PS_FR_DEPT_TBL/record[DEPTID=/mvc:eForm/mvc :D ata/EF_TRAVEL_CLAIM/record/DEPTID]/DESCR
Thanks!
RE: Update fields based on select value
When using the +?+?++based on server data+?+?+? option for an event, the value is determined from the server data when the page is rendered, not when the actual event fired. This means that you unfortunately won+?+?+?t be able to use this approach to achieve what you are trying to do, as the user won+?+?+?t yet have selected a value when this XPath is evaluated.
Instead I think you have a few different options to try and achieve this:
As all the fields are hidden, displaying the partial page on the main page shouldn+?+?+?t have any visual impact, and you should be able to configure the submission bindings for the values on the partial page as needed for your final action submission.
[/*]
document.getElementById(+?+?++descr_select+?+?+?).selectedIndex = document.getElementById(+?+?++deptid_select+?+?+?).selectedIndex;
As long as you apply the +?+?++hide+?+?+? class name to these extra select boxes, then they should not be visible on screen.
[/*]
[/*]
I hope these different approaches make sense, and help you make some progress on this.
Let me know if you have any questions.
Regards,
Gerard
RE: Update fields based on select value
Thanks. That's what I was afraid of. I was able to do a partial page as you recommended. I put an update in the page load actions to update the hidden and display fields.
Gary