Search code examples
ajaxjsfrichfacesrender

How to skip a child component during ajax-rendering the parent component?


I am using RichFaces. When I ajax-render a <rich:panel>, I don't want to render an <h:inputText> child of this panel. For example:

<rich:panel id="A">
    <h:inputText id="B" value="B" ></h:inputText> 
    <h:inputText id="C" value="C" ></h:inputText> 
    <h:inputText id="D" value="D" ></h:inputText> 
    ...
    <a4j:commandButton id="button"  value="click me" render="A" />
</rich:panel>

When I click the button, I intend to render the panel with id="A", but I don't want to render the input text with id="B". How can I render this whole region except of input text with id="B"?


Solution

  • INMO

    You should add a wrapper to C and D and render it like this

    <h:panelGroup id="CD">
        <h:inputText id="C" value="C" ></h:inputText> 
        <h:inputText id="D" value="D" ></h:inputText> 
    </h:panelGroup>
    <a4j:commandButton id="button"  value="click me" render="CD" />
    

    Or just specify their ids directly in the render attribute , like this

    <a4j:commandButton id="button"  value="click me" render="C D" />