5 Replies Latest reply on Jun 26, 2009 7:23 PM by Stefano C

    Combobox & onselect / onchange action

    Pieter Bosman Newbie

      Hello all,

      First of all, thanks for reading!

      I'll go straight into the issue.
      The basic question is how do I get my webapplication to call a method in my backingbean whenever my selection changes in my combobox. Sounds easy enough, but I've been getting head-aches for days now :(

      Anyways, here's the code-snippet for my jsp page.

      <rich:tab label="Skills">
       <h:panelGrid columns="2">
       <h:panelGrid columns="2" id="addSkill">
       <h:outputText value="Selecteer Vaardigheid: " />
       <rich:comboBox directInputSuggestions="true" id="addSkillList"
       defaultLabel="Selecteer Vaardigheid..."
       value="#{sessionManager.toBeAddedVaardigheid}" required="true"
       width="250" onchange="#{sessionManager.toBeAddedVaardigheid}">
       value="#{sessionManager.availableVaardighedenTable}" />
       <h:outputText value="Kostprijs:" />
       <h:inputText value="#{sessionManager.teBetalenEp}"
       required="true" />
       <h:outputText value=" " />
       <a4j:commandButton value="Add" id="addSkillButton"
       reRender="personageSelectionGrid, globalPanel, actionPanel, editPanel, deletePanel, loggingPanel"
       action="#{sessionManager.addSelectedVaardigheid}" />
       <h:panelGrid columns="1" border="1" cellspacing="5" cellpadding="2">
       <rich:messages style="color:red;"></rich:messages>

      The weird thing is that when I press my 'add'-button the setter method for the value linked to the combobox is fired.
      However I wish for some way to fire 'a' method whenever the selection changes

      any and all replies are appreciated!