Hello
I have a scenario below:
A select box in an editable table has 3 values respectively (web, development, testing).
Then i insert into the database the value that the user selects. (for example testing).
When i pull the data from the database into another select box that is also within a table, it defaults to 'web', instead of 'testing' b/c web is the first in the list.
How can i have the select box value display the value from the database?
Thank you in advance.
I have a scenario below:
A select box in an editable table has 3 values respectively (web, development, testing).
Then i insert into the database the value that the user selects. (for example testing).
When i pull the data from the database into another select box that is also within a table, it defaults to 'web', instead of 'testing' b/c web is the first in the list.
How can i have the select box value display the value from the database?
Thank you in advance.
RE: How to default select box value to value from database
For each select box, you should see a Field Value Page Display Binding on the Data Bindings tab. This is used to set the current value to display in the select box.
If this is pointing to your current value retrieved from the Database then it should pre select this entry, as long as the select box has an option with the matching value.
Is this not what you are seeing? If so can you provide some more details on your setup to help track down the problem?
Regards,
Gerard
RE: How to default select box value to value from database
First, select box 'SvrType' is filled w/ values from a DB table called SO_SvrType (3 columns: DispOrder, SvrType and DispFlag)
Field value in data bindings is pointing to the value retrieved from another DB table called TempParam. (which is what i want), but it is does not default.
Select Box Options Location is referring to record of SO_SvrType.
Select Box Options Data Value points to column SvrType of SO_SvrType
Select Box Options Display Text points to column SvrType of SO_SvrType
RE: How to default select box value to value from database
As your select box is showing dynamic options from the SO_SvrType, and is also within a repeating table, you will need to use the 'repeat variable' to indicate exactly where to get the current value from.
If you click the down arrow next to XPath Guidelines it should show the repeat variable value (see http://www.hyfinity.com/node/86).
You should then change your Field Value binding for the SvrType field to be $<repeat name>LoopEntry/SrvType
This tells it that the field value should come from the SrvType element from your TempParam structure (which is what the repeat variable is pointing to), rather than trying to use a SrvType value from under SO_SrvType.
Hopefully this change will make the select box default correctly.
Regards,
Gerard
RE: How to default select box value to value from database
I made the change but the select box is still not defaulting correctly.
There must be something else I am missing.
[attachment=0]Capture.GIF[/attachment]
[Posted on Dec 23 2011]
After refreshing the project multiple times. It worked, not sure why it took multiple refreshes though.
Thank you!
RE: How to default select box value to value from database
That binding configuration looks ok, so I am surprised it is not working correctly.
Is there any way you can provide a project export to let me look into this further? Alternatively could you provide just the generated page XSL file and the example data that shows the problem?
I can provide an email address if you would prefer not to post it on the forum.
Thanks,
Gerard
RE: How to default select box value to value from database