繁体   English   中英

a4j:support 函数在 h:commandLink 中只被调用一次

[英]a4j:support function getting called only once in h:commandLink

我使用的是 JSF 1.2、Seam 2.2.2 和 Richfaces 3.3.3。 我有一个 a4j:support 事件,当有人将鼠标悬停在链接上时会调用该事件。 但是这个函数在页面加载后只被调用一次。 如果我再次将鼠标悬停在链接上,a4support 事件不会调用该函数。 任何人都知道可能是什么原因?

<s:div style="padding-top:10px;">
<rich:dataTable id="pendingOptyTbl" value="#{searchResultList}"
    var="item" style="width: 100%; border: none;">
    <rich:column style="border: none;">
         <s:div>
               <h:outputText value="#{item.label} : " />                
               <h:outputLink value="/aafdemo/pages/#{item.label}/#{item.label}.seam"  styleClass="actionLink">                  
                   <h:outputText value="#{item.value.name}" />
                   <f:param name="#{item.label}Id" value="#{item.value.id}" />
                   <a4j:support event="onmouseover" immediate="true"    action="#searchController.test()}" ajaxSingle="true" reRender="details"/>
                 </h:outputLink>
          </s:div>
    </rich:column>
</rich:dataTable>

像这样修改你的输出 div:

<h:panelGroup id="details"><s:div style="float:right;" rendered="#{resultObject!=null}"> <h:outputText value="details" /> <h:outputText value="#{resultObject.value.id}"/> </s:div></h:panelGroup>

元素需要始终渲染才能工作!

编辑:正如 Luiggi 提到的,bean resultObject 必须在 SessionScope 或 KeepAlive

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM