0

I am using RichFaces 3.3.x and Tomahawk. I have an input field which has a4j:support on onkeyup and I am using 'process' to update the backing bean. Afterwards I use 'reRender' to get my backing bean (freshly) created div. Unfortunately the getter of the session scoped bean created Div is not called! What should I do?

<t:inputText id="searchString"
    value="#{beans.searchString}"
    onkeydown="if (event.keyCode == 13) { return false; }">
    <a4j:support event="onkeyup" requestDelay="200" ajaxSingle="true"
        reRender="resultsDiv" eventsQueue="quicksearchqueue"
        ignoreDupResponses="true"
        process="searchString" 
    />
</t:inputText>
<t:div id="results" binding="#{bean.resultsDiv}" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Jochen
  • 1,746
  • 4
  • 22
  • 48

2 Answers2

0

Firstly, the id you put in a4j:support to reRender is "resultsDiv" which is different from "results" id of . If this is not the origin of your problem, try to put the region you want to update within ajax inside an ajax rendered outputPanel, example:

<a4j:outputPanel id="resultsDiv" ajaxRendered="true" >
  <t:div id="results" binding="#{bean.resultsDiv}" />
</a4j:outputPanel>

And of course use the outputPanel's id in the reRender value of a4j:support

Laabidi Raissi
  • 3,263
  • 1
  • 22
  • 28
0

Except for the wrong ids in the code above, I had the same problem. I used a rich:tree and the reRender attribute to rerender a dynamic generated div component. It simply did not work. If you use a rich:panel instead of the div component, it will work just fine:

<t:inputText id="searchString"
    value="#{beans.searchString}"
    onkeydown="if (event.keyCode == 13) { return false; }">
    <a4j:support event="onkeyup" requestDelay="200" ajaxSingle="true"
        reRender="results" eventsQueue="quicksearchqueue"
        ignoreDupResponses="true"
        process="searchString" 
    />
</t:inputText>
<rich:panel id="results" binding="#{bean.yourPanel}" />

In the backing bean you put your generated div as a child to the rich panel component like this:

yourPanel.getChildren().add(yourGeneratedDiv);

I have no idea why it does not work with the t:div component though. Any answer on this would be appreciated.

M F
  • 323
  • 1
  • 3
  • 15