Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 调用rerender事件后,动态创建的Div未得到更新_Jsf_Richfaces_Tomahawk_Rerender - Fatal编程技术网

Jsf 调用rerender事件后,动态创建的Div未得到更新

Jsf 调用rerender事件后,动态创建的Div未得到更新,jsf,richfaces,tomahawk,rerender,Jsf,Richfaces,Tomahawk,Rerender,我正在使用RichFaces3.3.x和Tomahawk。我有一个输入字段,在onkeyup上有一个4j:support,我正在使用“process”更新备份bean。之后,我使用“reRender”获得我的支持bean(新创建的)div。不幸的是,会话范围的bean创建的div的getter没有被调用!我该怎么办 <t:inputText id="searchString" value="#{beans.searchString}" onkeydown="if (even

我正在使用RichFaces3.3.x和Tomahawk。我有一个输入字段,在onkeyup上有一个4j:support,我正在使用“process”更新备份bean。之后,我使用“reRender”获得我的支持bean(新创建的)div。不幸的是,会话范围的bean创建的div的getter没有被调用!我该怎么办

<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}" />

首先,您在a4j:support to reRender中输入的id是“resultsDiv”,它不同于的“results”id。 如果这不是问题的根源,请尝试将要在ajax中更新的区域放在ajax呈现的输出面板中,例如:

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


当然,在a4j:support的reRender值中使用outputPanel的id

除了上面代码中的错误id之外,我也遇到了同样的问题。我使用了rich:tree和reRender属性来重新渲染动态生成的div组件。它根本不起作用。如果使用rich:panel而不是div组件,它将正常工作:

<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}" />
我不知道为什么它不能与t:div组件一起工作。对此,如有任何答复,将不胜感激

yourPanel.getChildren().add(yourGeneratedDiv);