0

How to inform Composer on selected item in combobox ?

asked 2009-12-02 06:31:09 +0800

marioosh gravatar image marioosh
75 1 3

How to get in MyComposer which item is selected from combobox ? I get null :(

<window id="autowin" apply="ui.MyComposer">
	<combobox id="combo" selectedIndex="@{autowin$MyComposer.selected}"/>
</window>

public class AutoComposer extends GenericForwardComposer {
            Object selected;

	public void onChanging$combo(Event evt) {
		System.out.println(selected); // null
	}
}

delete flag offensive retag edit

12 Replies

Sort by ยป oldest newest

answered 2011-06-03 23:56:00 +0800

ajaidka gravatar image ajaidka
196 4

Thanks caclark

I tried this way before, but control was not coming in onCreate method, reason could be I declared this method without 'ForwardEvent' paramater. Will try this too.

Meanwhile, there is another way around :
In .zul file
<combobox id="billCountry"
onCreate="self.setSelectedIndex(editCompanyInfoWin$composer.getCurrentBillCountryIndex())">
.....
.....
</combobox>


Many thanks,
AJaikda

link publish delete flag offensive edit

answered 2011-06-08 21:14:37 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

If you set a model to the combobox, you can set the selection to model,
please refer to the component reference.

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: 2009-12-02 06:31:09 +0800

Seen: 4,608 times

Last updated: Jun 08 '11

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