-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I am creating a Listitem that contains a listbox (as a dropdown) and could/could not contain an intbox. If the user choose item1 of the dropdown, I want to add the intbox to the end. If the user chooses item2, I want to remove the intbox from the end. I am creating everything progamtically, so the question is how do I say
dropdown.onChange = { if(selectedItem.value = "item1") { show myIntbox } else { remove myIntbox } }
You should use onSelect instead.
What are you using for the presentation? A GenericForwardController? and a Zul?
I just tested this code that makes my username textbox disappear if you select the second item in my listbox:
public void onClick$lstType(Event event) { Listbox lst = (Listbox)event.getTarget().getFellow("lstType"); Textbox box = (Textbox)event.getTarget().getFellow("txtUsername"); if (lst.getSelectedIndex() == 2) { box.setVisible(false); } }
You should be able to adapt that for your own purposes. If you get stuck, just post here and I'll see if I can help you further.
Asked: 2010-09-05 19:23:09 +0800
Seen: 621 times
Last updated: Sep 06 '10