user1555524
user1555524

Reputation: 195

a4j:support function getting called only once in h:commandLink

I am using JSF 1.2, Seam 2.2.2 and Richfaces 3.3.3. I have an a4j:support event that is being called when someone hovers on the link. But this function is being called only once after the page loads. If i mouseover again on the link, a4support event does not call the function. Any body have any idea what can be the reason?

<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>

Upvotes: 1

Views: 964

Answers (1)

Alexandre Lavoie
Alexandre Lavoie

Reputation: 8771

Modify your output div like this :

<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>

The element need to always be rendered for this to work!

EDIT : As Luiggi mentionned, the bean resultObject must be in SessionScope or KeepAlive

Upvotes: 2

Related Questions