3 Replies Latest reply on Dec 8, 2008 6:35 AM by Karl Philipp

    <rich:inputNumberSpinner> and Action Method of a CommandButt

    Karl Philipp Newbie

      I've a dialog that consists of several simple inputText elements and an inputNumberSpinner element rendered as follows (a lttle bit simplified for the forum):

      <rich:modalPanel id="spSubscriberPanel" height="300" width="400" zindex="9999" style="overflow: auto;">
       <f:facet name="header">
       <h:outputText value="Enter FLN" />
       </f:facet>
       <f:facet name="controls" />
       <a4j:form>
       <a4j:include viewId="/pages/serviceProvider/addFixedlinenumbers.xhtml" />
       </a4j:form>
       </rich:modalPanel>


      and

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
       <h:panelGrid columns="2">
       <h:outputLabel for="localAreaCode" value="Local AreaCode:" />
       <h:inputText id="localAreaCode" value="#{sps.fln.localAreaCode}" />
       <h:outputLabel for="fixedLineNumber" value="Fixed Line Number:" />
       <h:inputText id="fixedLineNumber" value="#{sps.fln.fixedLineNumber}" />
       <h:outputLabel for="statusId" value="Status Id" />
       <rich:inputNumberSpinner id="statusId" minValue="1" maxValue="10" step="1" value="#{sps.fln.statusId}" />
       </h:panelGrid>
       <a4j:commandButton value="Close" reRender="sp" action="#{sps.addFLN}">
       <rich:componentControl for="spSubscriberPanel" event="onclick" operation="hide" />
       </a4j:commandButton>
       <a4j:commandButton value="Cancel" action="#{sps.cancelSubscriberData}">
       <rich:componentControl for="spSubscriberPanel" event="onclick" operation="hide" />
       </a4j:commandButton>
      
      </ui:composition>


      I figured out that the action method sps.addFLN (attached to the commanButton "Close") is only performed if the user has changed the value of the input field represented by the rich:inputNumberSpinner element.

      Is it possible to change this behaviour? That is, the action method sps.addFLN shall be always performed, independent of the fact that the user has NOT changed the value of rich:inputNumberSpinner field. I set aside the question, whether it makes sense (for now).

      --
      Facelets 1.1.14 | RF 3.2.2.SR1 | Apache MyFaces 1.2 | JBoss 4.2.3.GA