4 Replies Latest reply on Sep 20, 2007 5:30 AM by ameo

    JSF and all commandButtons are fired

    ameo

      Hello,

      I have a jsf-portlet. Now, when I click a commandButton of that jsf all the methos of the underlying Managed-Bean are processed. Why ?

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <f:view>
      <h:form id="main">
      ..
      <h:commandButton id="b1" type="submit" action="#{Bean.calit}" value="Calculation"/>
      ..
      <h:commandButton id="b2" type="submit" action="#{Bean.calit2}" value="Calculation 2"/>
      </h:form>
      </f:view>

        • 1. Re: JSF and all commandButtons are fired
          den74

          i think you have wrong something in declaration. The right one is:

          <h:commandButton action="#{Bean.calit}" value="#{Calculation}"/>

          you don't need to specify type="submit"

          • 2. Re: JSF and all commandButtons are fired
            ameo

             

            "den74" wrote:
            <h:commandButton action="#{Bean.calit}" value="#{Calculation}"/>


            Thanks for answer!

            The value attribute of the commandButton can be a literal text or a value-binding expression. So this one have to work:

            <h:commandButton id="b1" type="submit" action="#{Bean.calit}" value="Calculation"/>


            I created a new JSF and a new portlet and this works fine, but I don't know why previous example dones't work. Maybe because of IPC ?



            • 3. Re: JSF and all commandButtons are fired
              ameo

              The Problem ist not a jsf problem. It relies von IPC. The portlet on a page without IPC works, the one with IPC fires all actions on the button. Who have experience with IPC and JSF ?

              • 4. Re: JSF and all commandButtons are fired
                ameo

                Nice, I testet again.

                I take only one Portlet. The portlet is an JSF Portlet and have 2 commandButtons.

                Now, when I activate with the admin tool the partial refresh feature, all action methods of all buttons are fired.

                when I deactivate partial refresh all works.

                Is this a Bug ?