|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tonbeller.wcf.list.MappedListBox
THIS IS CRAP - DONT USE!
stateful listbox. initialize():
Element parent = ...
// erzeuge Listbox Element
Element lb = ListBox1.addListBox1(parent);
ListBox1.setId(lb, DomUtils.randomId());
ListBox1.setLabel(lb, p.getLabel());
// create MappedListBox
MappedListBox mlb = new MappedListBox(lb);
// add Items
Object[] objs = ...
for (int i = 0; i < objs.length; i++) {
Object o = objs[i];
MappedListBox.Item item = new MappedListBox.Item(hier.getLabel(), o);
mlb.getEntries().add(item);
if (some condition)
item.setSelected(true);
}
mlb.sortByLabel();
// create DOM Elements
mlb.revert();
validate():
mlb.validate(context);
MappedListBox.Item item = mlb.getSingleSelection();
if (item != null)
... // work with selection
revert():
mlb.revert();
| Nested Class Summary | |
static class |
MappedListBox.Item
listbox entry |
| Constructor Summary | |
MappedListBox(org.w3c.dom.Element listBox)
|
|
| Method Summary | |
java.util.List |
getEntries()
Returns the entries. |
MappedListBox.Item |
getSingleSelection()
|
void |
revert(RequestContext context)
reverts this component to model values |
void |
setEntries(java.util.List entries)
Sets the entries. |
void |
sortByLabel()
|
boolean |
validate(RequestContext context)
validates user input and updates the model |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MappedListBox(org.w3c.dom.Element listBox)
| Method Detail |
public void revert(RequestContext context)
FormListener
revert in interface FormListenerpublic boolean validate(RequestContext context)
FormListener
validate in interface FormListenerpublic MappedListBox.Item getSingleSelection()
public void sortByLabel()
public java.util.List getEntries()
public void setEntries(java.util.List entries)
entries - The entries to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||