5 Replies Latest reply on Sep 17, 2008 8:09 AM by Raluca Jucan

    rich:modalPanel Problem

    Raluca Jucan Newbie

      Link in rich:modalPanel doesn't work. I call a rich:modalPanel, where I rerender a combobox list and when I try to submit my form it doesn't work.

      I have the following code:

      <rich:modalPanel width="290" height="200" id="presentContact" >
      ... // text

      <h:selectOneMenu value="#{handler.toPresentFriendSI}">
      <f:selectItems value="#{handler.toPresentFriendsSI}" />

      <a4j:commandLink value="present" action="#{handler.presentFriend}"/>

      <a4j:commandLink value="cancel" onclick="#{rich:component('presentContact')}.hide()"/>

      The panel is called here:

      <a4j:commandLink actionListener="#{handler.getFriendsToPresent}" reRender="presentContactCombo" value="Present"
      <f:param value="#{handler.contactId}" name="ddd" id="presContact"/>

      Here is my function from the handler:

      public void getFriendsToPresent(ActionEvent event){
      UIParameter component = (UIParameter) event.getComponent().findComponent("presContact");
      contactId = Integer.parseInt(component.getValue().toString());

      for (SNUser user : toPresentFriends) {
      if(user.getId() != friend.getId()){
      toPresentFriendsSI.add(new SelectItem(user.getId() + "", user.getForename() + " " + user.getSurname()));

      I have a list of contacts and to each contact i can present another contact.
      The list will be generated according to the user to whom I want to present another friend,
      so for each user I have a different list and since my I have only one component I rerender each time the list.
      The list is generated as it should be, and everything looks fine but when I try to submit the function from the handler isn't called. When I don't rerender the combo my form works with no pb.

      Any ideas how I could work around this?