-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I want to select the first item on rsListBox before doBeforeComposeChildren() method.
How to select the first item on onSelect$rsListBox below programmatically?
public void onSelect$rsListBox(Event evt) {
this.fcst_sensor_id = (String)rsListBox.getSelectedItem().getValue();
String header = (String)rsListBox.getSelectedItem().getLabel();
this.HeadingTitleReservoir.setLabel(header);
System.out.println("Selected id:" + this.fcst_sensor_id);
}
Before doBeforeComposeChildren
... there's nothing rendered yet so you can't select a listitem at this point.
onSelect$rsListBox
is an event listener which also will only trigger if a component receives an event. If not yet rendered there won't be an event.
Said that, the think you might have to look into is model-based rendering (either by template or item renderer). i.e. you populate the data and selected object(s) before the rendering happens.
here an example http://zkfiddle.org/sample/3ajgh1d/1-listbox-with-model-and-initial-selection
Asked: 2018-10-19 01:29:19 +0800
Seen: 7 times
Last updated: Oct 19 '18
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate