4 Replies Latest reply on Feb 20, 2008 4:40 AM by Assmaa Omar

    does there aproblem with h:outputlabel and a4j:support ?

    Assmaa Omar Newbie

      SA

      I am trying to use a4j:support tag with h:outlabel but it doesn't work

      <h:outputLabel value="Label" >
      <a4j:support event="onclick" reRender="outlabel" actionListener="#{bean.testOutputAjax}" />
      </h:outputLabel>
      <h:outputLabel id="outlabel" value="#{bean.name}" />

      but a4j:support woks good with outputText

      <h:outputText value="Text" >
      <a4j:support event="onclick" reRender="outtext" actionListener="#{bean.testOutputAjax}" />
      </h:outputText>
      <h:outputText id="outtext" value="#{bean.name}" />

      why this occured?
      I saw the generated html code (source code ) of jsp page
      I found that onclick of outputText is generated but not generated for outputlabel

      this is the generated code

      <span onclick="A4J.AJAX.Submit('_viewRoot','form',event,{'parameters':{'form:_idJsp9':'form:_idJsp9'} ,'actionUrl':'/ajaxx-AjaxApplication-context-root/faces/datatablerowrefresh.jsp;jsessionid=c0a80002231c853ccf1aa6da4b1a8d73d3d0b231f179'} )">Text
      assmaa


      Label


      assmaa
      what is the problem? how can iu solve it?



      but in another page i use h:outlabel with a4j and it works well

      <f:facet name="foo-folder" >
      <h:panelGroup>
      <f:facet name="expand">
      <t:graphicImage value="../../images/folder-open.gif"
      rendered="#{t.nodeExpanded}"
      alt="" border="0"/>
      </f:facet>
      <f:facet name="collapse">
      <t:graphicImage value="../../images/folder-closed.gif"
      rendered="#{!t.nodeExpanded}" border="0"/>
      </f:facet>
      <h:outputLabel id="commandDescription2" value="[#{node.id}] #{node.description}" styleClass="treepage-link" >
      <a4j:support event="onclick" actionListener="#{TableHeaderBean.changeTreeHeader}" reRender="tableHeader"/>
      </h:outputLabel>
      </h:panelGroup>
      </f:facet>


      but here doesn't work

      the only changes if the name of images
      and facet name

      <f:facet name="person-highlight">
      <h:panelGroup>
      <f:facet name="expand">
      <t:graphicImage value="../../images/blue-folder-open.gif"
      rendered="#{t.nodeExpanded}"
      alt="Can't find the image" border="0"/>
      </f:facet>
      <f:facet name="collapse">
      <t:graphicImage value="../../images/blue-folder-closed.png"
      rendered="#{!t.nodeExpanded}"
      alt="Can't find the image" border="0"/>
      </f:facet>
      <h:outputLabel id="commandDescription4" value="[#{node.id}] #{node.description}" styleClass="treepage-link"
      >
      <a4j:support event="onclick" actionListener="#{TableHeaderBean.changeTreeHeader}" reRender="tableHeader" />
      </h:outputLabel>
      </h:panelGroup>
      </f:facet>

      best Regards