PDA

View Full Version : <combobox> tag


sandman
03-21-2003, 11:31 AM
Is there an example that shows how to create a drop down?

antun
03-21-2003, 11:52 AM
Have a look here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=27&highlight=combobox

Is that what you mean?

-Antun

sandman
03-21-2003, 12:41 PM
I looked at the example and tried it but I don't see the options for the drop down. The number of elements are correct but the options are not getting displayed. I just see blanks. Here is code snippet I am using:

<dataset name="monthsDS">
<months>
<month>Jan</month>
<month>Feb</month>
</months>
</dataset>

<combobox id="leaveMonth" x="16" y="60" width="142" shownitems="1" itemfield="monthsDS:/months/month.text()" />

sandman
03-21-2003, 12:57 PM
I think the problem was because of the way I am using the dataset in the combobox. When I changed it to:

<combobox id="leaveMonth" x="16" y="60" width="142" shownitems="1" itemfield="monthsDS:/months[1]/month/text()" />

Now I see only "Jan" in the options to select from. What do I need to do to make both "Jan" and "Feb" appear in the selection list.

antun
03-21-2003, 01:06 PM
Hey sandman

I was getting that too. The syntax for the contents of a text node in XPath is now /text() instead of .text() (as shown in the Tip). This is to be more in line with XPath Syntax as defined by the W3C.

I'm still trying to figure out whether it's a bug with the combobox or if there's something wrong with your code. Will post as soon as I know.

-Antun


Originally posted by sandman

<combobox id="leaveMonth" x="16" y="60" width="142" shownitems="1" itemfield="monthsDS:/months[1]/month/text()" />

Now I see only "Jan" in the options to select from. What do I need to do to make both "Jan" and "Feb" appear in the selection list.

sandman
03-24-2003, 09:28 AM
How do I select an option in the combobox by default?