1 Reply Latest reply on Jul 15, 2010 6:15 PM by Serkan Eskici

    Cannot pass value via actionListener

    Tanya Ruttenberg Expert

      doorsHome.instance is an instance of the Doors object. The contactId is the Id for the object.  It is an integer.  The value resolves just fine and the label on the button states

        Create New Contact 2348

      Value of doorsHome.instance.contactId is 2348.

      <a4j:commandButton ajaxSingle="true" value="Create New Contact #{doorsHome.instance.contactId}" reRender="p1"
                actionListener="#{alternate1Home.createContact(doorsHome.instance.contactId)}" />

      the actionListener is defined as follows (for the moment):

           public void createContact(Integer d) {

      alternate1Home.createContact(doorsHome.instance.contactId) the value that is passed in is 0. Or rather, no value is passed in and the new Integer object has a value of 0.

      However, alternate1Home.createContact(2348)

      passes in 2348 correctly.

      What is going on here?  Why does the object that is being passed in not actually make it to the actionListener?