0

I am writing a custom jsf Renderer for checkboxes and radio buttons to render without TABLE element. My question is if I have a select box like below

    <h:selectManyCheckbox id="vehicle" value="#{pageBean.vehicle}>
       <f:selectItems value="#{pageBean.vehiclesList} />
    </h:selectManyCheckbox>

in the encodeBegin method how can I read the vehiclesList?

Nithin Satheesan
  • 1,546
  • 3
  • 17
  • 30

1 Answers1

0

It was straight forward.

Iterator<UIComponent> iterator = component.getFacetsAndChildren();

while (iterator.hasNext()) {
    UIComponent childComponent = iterator.next();
    List vehicles = childComponent.getValueExpression("value").getValue(context.getELContext);
    // Do whatever with vehicles.
}

Here I assumed that there is only one child to the main component which is SelectItems.

Nithin Satheesan
  • 1,546
  • 3
  • 17
  • 30