Woodstock to ICEfaces Component Mapping

webuijsf:editableList to ice:selectInputText

Summary

The functionality of webuijsf:editableList can easily be replicated with ice:selectInputText and some code in the backing bean.

TLD Comparison

Woodstock ICEfaces Comments
Common Attributes    
binding binding -
disabled disabled -
fieldValidatorExpression validator -
id id -
maxLength maxlength -
readOnly readonly -
rendered rendered -
required required -
rows rows -
style style -
styleClass styleClass -
tabIndex tabindex -
toolTip title -
valueChangeListenerExpression valueChangeListener -
visible visible -
width width -
Similar Attributes    
list listValue listValue must bind to a list in the backing bean that contains objects of type SelectItem.
Unique Attributes    
fieldLabel - -
labelLevel - -
listLabel - -
listOnTop - -
listValidatorExpression - -
multiple - -
sorted - -
- accesskey -
- action -
- actionListener -
- alt -
- autocomplete -
- converter -
- dir -
- effect -
- enabledOnUserRole -
- immediate -
- lang -
- listVar -
- onblur -
- onchange -
- onclick -
- onclickeffect -
- ondblclick -
- ondblclickeffect -
- onfocus -
- onkeydown -
- onkeydowneffect -
- onkeypress -
- onkeypresseffect -
- onkeyup -
- onkeyupeffect -
- onmousedown -
- onmousedowneffect -
- onmousemove -
- onmousemoveeffect -
- onmouseout -
- onmouseouteffect -
- onmouseover -
- onmouseovereffect -
- onmouseup -
- onmouseupeffect -
- onselect -
- partialSubmit -
- renderedOnUserRole -
- size -
- textChangeListener -
- value -

Usage Examples

<webuijsf:editableList id="editableList1" list="#{EditableListBean.list}" />



<ice:commandButton value="Add" actionListener="#{EditableListBean.add}" partialSubmit="true"/>
<ice:commandButton value="Remove" actionListener="#{EditableListBean.remove}" partialSubmit="true"/>
<ice:selectInputText id="editableList1" value="#{EditableListBean.value}" partialSubmit="true">
    <f:selectItems value="#{EditableListBean.list}" />
</ice:selectInputText>

<!-- 
    
    EditableListBean must contain the following properties:
    
    private List list;
    private String value;
    
    It must also define the following methods:
    
        public void add(ActionEvent e) {

            if (this.value != null) {
                boolean found = false;
                Iterator i = list.iterator();
                while (i.hasNext()) {
                    SelectItem item = (SelectItem) i.next();
                    if (item.getLabel().equals(this.value)) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    list.add(new SelectItem(this.value));
                    this.value = null;
                }
            }
        }
    
    public void remove(ActionEvent e) {

        if (this.value != null) {
            Iterator i = list.iterator();
            while (i.hasNext()) {
                SelectItem item = (SelectItem) i.next();
                if (item.getLabel().equals(this.value)) {
                    list.remove(item);
                    this.value = null;
                    break;
                }
            }
        }
    }
    
-->