The code below is from an example in the Learning XDialog Sample Application. I'm trying to initialize the value of the select control, but can't figure out how. The method I'm using below isn't working. I would think there must be a way to set the initial value in cases where you are getting data from a table and want to set the value in the list to the value in the table.
Should I be using an html input dropdown instead of an A5 Control?
If you know of a solution please post it.
Thanks,
BobA
dim htmlForm as p
htmlForm.html = <<%html%
<a5:bindings>
<a5:binding id="dynList" variable="currentSelection" />
</a5:bindings>
<!--
In a select control the "a5:listExpression" attribute allows you to define an expression to generate the options.
The expressions should return a "crlf" delmilited list.
If you wish the displayed text to be differnet than the value for the option, use a "|" ("text|value").
-->
<select id="dynList" a5:listExpression="list"></select>
%html%
dim list as c
dim currentSelection as c
list = <<%str%
One|1
Two|2
Three|3%str%
'this is my attempt to initalize the value in the list. it will 'only change after the xdialog form is displayed.
currentSelection = "3"
ui_dlg_box("HTML Forms - Dynamic Select",<<%dlg%
{frame=1,1:HTML Form}
{region}
{wrap=50}
This drop down list is in an HTML form. The choices in the dropdown list are dynamically populated from the Xdialog variable 'list' shown below. Notice how the choices in the dropdown list change dynamically as you edit the value in the 'list' variable.;
{HTMLForm=40,.75"htmlForm};
{endregion};
{lf};
{region}
Current Select: |[.40currentSelection];
List: |[%m%.40,10list]
{endregion}
%dlg%)
Should I be using an html input dropdown instead of an A5 Control?
If you know of a solution please post it.
Thanks,
BobA
dim htmlForm as p
htmlForm.html = <<%html%
<a5:bindings>
<a5:binding id="dynList" variable="currentSelection" />
</a5:bindings>
<!--
In a select control the "a5:listExpression" attribute allows you to define an expression to generate the options.
The expressions should return a "crlf" delmilited list.
If you wish the displayed text to be differnet than the value for the option, use a "|" ("text|value").
-->
<select id="dynList" a5:listExpression="list"></select>
%html%
dim list as c
dim currentSelection as c
list = <<%str%
One|1
Two|2
Three|3%str%
'this is my attempt to initalize the value in the list. it will 'only change after the xdialog form is displayed.
currentSelection = "3"
ui_dlg_box("HTML Forms - Dynamic Select",<<%dlg%
{frame=1,1:HTML Form}
{region}
{wrap=50}
This drop down list is in an HTML form. The choices in the dropdown list are dynamically populated from the Xdialog variable 'list' shown below. Notice how the choices in the dropdown list change dynamically as you edit the value in the 'list' variable.;
{HTMLForm=40,.75"htmlForm};
{endregion};
{lf};
{region}
Current Select: |[.40currentSelection];
List: |[%m%.40,10list]
{endregion}
%dlg%)