4 Replies Latest reply on Apr 14, 2010 7:08 AM by harut

    <a4j:support> not working inside <h:inputText> (Most of times)

    jsfgeeks

      Hi all,

       

             I have faced this problem many times. When I use <a4j:support> inside <h:inputText>, it won't work in most of <h:inputText>.

       

           e.g.

       

         <h:panelGrid id="pnl_create_remove_node" columns="5">
      <h:inputText id="intxt_create_node" value="#{dynamic_tree.txtTopic}"
      style="font-size: 13px">
      <a4j:support event="onkeyup" onsubmit="if (event.keyCode!=13) return false; "
      focus="intxt_create_node"
      action="#{dynamic_tree.addNode}"
      reRender="rightContainer,pnl_create_remove_node"/>
      </h:inputText>
      <rich:spacer width="5" height="5"/>
      <a4j:commandButton id="btn_create_node" type="submit" value="Create"
      action="#{dynamic_tree.addNode}"
      reRender="rightContainer,pnl_create_remove_node"
      oncomplete="error_msg();"
      title=" Create new node "
      onmouseover="mouseOver('form1:btn_create_node')"
      onmouseout="mouseOut('form1:btn_create_node')"
      focus="intxt_create_node"
      style="font-size: 13px; font-weight: bold; width: 80px"/>
      <rich:spacer width="5" height="5"/>
      <a4j:commandButton id="btn_remove_node" value="Remove" action="#{dynamic_tree.removeNode}"
      reRender="rightContainer,pnl_create_remove_node"
      oncomplete="error_msg();"
      title=" Remove selected node "
      onmouseover="mouseOver('form1:btn_remove_node')"
      onmouseout="mouseOut('form1:btn_remove_node')"
      focus="intxt_create_node"
      style="font-size: 13px; font-weight: bold; width: 80px"/>
      <h:outputText id="outtxt_msg" binding="#{dynamic_tree.outtxt_msg}"
      style="font-size: 15px; color: red"/>
      <rich:effect id="efct_for_error_msg" name="error_msg"
      for="outtxt_msg" type="Highlight" params="duration:3.0" />
      </h:panelGrid>

       

      So, here it works fine. But, on the same page, I have search panel in which I have 1 <h:inputText> and 2 command buttons like below,

       

      <h:panelGrid id="pnl_search_topic" columns="2">
      <h:inputText id="intxt_search_topic"
      binding="#{dynamic_tree.intxt_search_topic}"
      style="font-size: 13px; width: 200px">
      <a4j:support event="onkeyup" onsubmit="if (event.keyCode!=13) return false; "
      focus="intxt_search_topic"
                                               ajaxSingle="true" limitToList="true"     <!-- optional -->
      action="#{dynamic_tree.action_search_topic}"
      reRender="pnl_search_topic,leftContainer"/>
      </h:inputText>
      <a4j:commandButton id="btn_search_topic" image="images/tree/btn_search.gif"
      binding="#{dynamic_tree.btn_search_topic}"
      style="font-size: 13px"
      reRender="pnl_search_topic,leftContainer"
      title="Search Topics"
      focus="intxt_search_topic"
      action="#{dynamic_tree.action_search_topic}"/>
      <a4j:commandButton id="btn_clear_search" image="images/tree/btn_clear_search.gif"
      binding="#{dynamic_tree.btn_clear_search}"
      style="font-size: 13px"
      reRender="pnl_search_topic,leftContainer"
      title="Clear Search"
      focus="intxt_search_topic"
      action="#{dynamic_tree.action_clear_search_topic}"/>
      </h:panelGrid>

       

      But, in search panel, it's not working. Scope of this page is session. Can anyone tell what I am doing wrong ?

       

      Thanks in advance,

      JSF GEEKS