0

Set the onChange event of a listbox to show/hide an Intbox all done programmatically

asked 2010-09-05 19:23:09 +0800

diego898 gravatar image diego898
246 3

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
}
}

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-09-06 02:32:13 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

You should use onSelect instead.

link publish delete flag offensive edit

answered 2010-09-06 09:12:38 +0800

diego898 gravatar image diego898
246 3

Yes I know but how do I setup the rest of it?

link publish delete flag offensive edit

answered 2010-09-06 10:43:50 +0800

SparkySpider gravatar image SparkySpider
444 1 3

What are you using for the presentation? A GenericForwardController? and a Zul?

link publish delete flag offensive edit

answered 2010-09-06 10:50:26 +0800

diego898 gravatar image diego898
246 3

yes I am

link publish delete flag offensive edit

answered 2010-09-06 15:29:05 +0800

SparkySpider gravatar image SparkySpider
444 1 3

updated 2010-09-06 15:30:51 +0800

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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-09-05 19:23:09 +0800

Seen: 621 times

Last updated: Sep 06 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More