JSF rendering

1

How do I render the components of Richfaces .

I have combobox and when I click on an item of it I want to render my form according to my item.

Examples please.

    
asked by anonymous 04.04.2014 / 04:29

1 answer

3

In order to update the screen partially, that is, only a part of it, after an action via Ajax you can use the update attribute if you have a button. See Richfaces documentation about this .

Example:

<a4j:commandButton value="update" reRender="infoBlock"/>
...
<h:panelGrid id="infoBlock">
    ...
</h:panelGrid>

In case you want to perform an update after selecting a combo item, this is possible with the <a4j:ajax> tag. See official example :

<h:form>
    <h:selectOneMenu value="#{selectsBean.currentType}" valueChangeListener="#{selectsBean.valueChanged}">
        <f:selectItems value="#{selectsBean.firstList}" />
        <a4j:ajax event="valueChange" render="second" execute="@this" />
    </h:selectOneMenu>
    <a4j:outputPanel id="second" layout="block">
        <h:selectOneMenu value="#{selectsBean.currentType}" rendered="#{not empty selectsBean.currentType}">
            <f:selectItems value="#{selectsBean.secondList}" />
        </h:selectOneMenu>
    </a4j:outputPanel>
</h:form>
    
04.04.2014 / 17:34