3 Replies Latest reply on Apr 8, 2008 12:13 PM by johnboy

    Strange...commandLink Issue.

    johnboy

      Let it be known I am really new to Ajax.

      I am trying to get the command link below to fire my listener without rerendering the entire form and change part of the page. (later)

      My datatable fills in correctly and all is good but when I press the command link I get the following in the error log of the browser and my Actionlistener does not get called:

      "A4J is not defined. "

      Can anyone spot anything. I am using The 3.2.0 GA Rich jars (now).


      Here is a code sample. See anything obvious?

      <h:form id="SVPSelection">
      <h:panelGroup>
      <f:view>
      <c:if test="${not empty SVPBean.currentSvp}">

      <h:panelGrid columns="1">
      <h:selectOneListbox id="pickSVP" value="#{ConfigurationBean.currentSvp}" size="1">
      <a4j:support event="onchange" actionListener="#{ConfigurationBean.agentChanged}" reRender="pickSVP" />
      <f:selectItems value="#{SVPBean.sig}" />
      </h:selectOneListbox>
      </h:panelGrid>

      </c:if>

      <h:dataTable id="configPanel" value="#{ConfigurationBean.names}" var="res" styleClass="configurationTable" style="border: thin solid black" rows="20">
      <h:column>
      <h:graphicImage value="#{res.iconloc}"></h:graphicImage>
      </h:column>
      <h:column>
      <a4j:commandLink id="configurationDetails" actionListener="#{ConfigurationBean.listen}" immediate="true" reRender="configMgr," value="#{res.resource}">
      </a4j:commandLink>
      </h:column>
      </h:dataTable>

      </f:view>
      </h:panelGroup>
      </h:form>

        • 1. Re: Strange...commandLink Issue.

          Why you have a f:view inside the panelGroup ?

          • 2. Re: Strange...commandLink Issue.
            johnboy

            Changed that good point. Still the same issue. If I convert to h:commandLink and all works but the whole page resubmits. I really need to not do this.

            <h:panelGrid columns="2" rows="1">
            <h:panelGroup>
            <a4j:form id="SVPSelection">
            <c:if test="${not empty SVPBean.currentSvp}">

            <h:panelGrid columns="1">
            <h:selectOneListbox id="pickSVP" value="#{ConfigurationBean.currentSvp}" size="1">
            <a4j:support event="onchange" actionListener="#{ConfigurationBean.agentChanged}" reRender="pickSVP" />
            <f:selectItems value="#{SVPBean.sig}" />
            </h:selectOneListbox>
            </h:panelGrid>

            </c:if>

            <h:dataTable id="configPanel" value="#{ConfigurationBean.names}" var="res" styleClass="configurationTable" style="border: thin solid black" rows="20">
            <h:column>
            <h:graphicImage value="#{res.iconloc}"></h:graphicImage>
            </h:column>
            <h:column>
            <h:commandLink id="configurationDetails" actionListener="#{ConfigurationBean.listen}" immediate="true" reRender="configGroupForm," value="#{res.resource}">
            </a4j:commandLink>
            </a4j:column>
            </h:dataTable>

            </a4j:form>
            </h:panelGroup>

            • 3. Re: Strange...commandLink Issue.
              johnboy

              Woops mistyped..
              <h:panelGrid columns="2" rows="1">
              <h:panelGroup>
              <a4j:form id="SVPSelection">
              <c:if test="${not empty SVPBean.currentSvp}">

              <h:panelGrid columns="1">
              <h:selectOneListbox id="pickSVP" value="#{ConfigurationBean.currentSvp}" size="1">
              <a4j:support event="onchange" actionListener="#{ConfigurationBean.agentChanged}" reRender="pickSVP" />
              <f:selectItems value="#{SVPBean.sig}" />
              </h:selectOneListbox>
              </h:panelGrid>

              </c:if>

              <h:dataTable id="configPanel" value="#{ConfigurationBean.names}" var="res" styleClass="configurationTable" style="border: thin solid black" rows="20">
              <h:column>
              <h:graphicImage value="#{res.iconloc}"></h:graphicImage>
              </h:column>
              <h:column>
              <a4j:commandLink id="configurationDetails" actionListener="#{ConfigurationBean.listen}" immediate="true" reRender="configGroupForm," value="#{res.resource}">
              </a4j:commandLink>
              </h:column>
              </h:dataTable>

              </a4j:form>
              </h:panelGroup>