I am new to wicket (2 months), it's been straight forward for me until I
started getting into modal windows and ajax.  I've notice there were many
topics on Modal Windows, but I could not find anything addressing my
particular question.  I apoligize in advance if this issue was already
discussed previously.  :)

Problem:

I have a modal window with a panel.  My form within the panel has a
ListMultpleChoice control.  I also have a AjaxSubmitLink for deleiting
choices within the ListMultpleChoice control.

Essentially, when clicking on the link, I retrieve the underlying model used
by the ListMultpleChoice control, remove the choice selected by the
ListMultipleChoice control, and redisplay the modal window.  But the
ListMulpleChoice control does the display the new choice list.  When I
manually close the modal window and open it via running my application, the
newly opened modal window has the choice removed from the list.  Therefore I
know the model is being updated.  I just need to the ListMulepleChoice to
reterive the new choices from the model and display it.  I tried many
different approches:  updateModel, addOrReplace control, etc. to no avail.

A snippent of the code used is as follows, taken from within the form, in
panel which is the contents to the modal window.

   // Project members 
    ListMultipleChoice projectMembers = 
      new ListMultipleChoice ("memberSelection", new PropertyModel(model,
"memberSelection"), 
          new PropertyModel(model, "projectMembers")) {
      /** Support serialization. */
      public static final long serialVersionUID = 1L;
    };
    projectMembers.setMaxRows(5);
    projectForm.add(projectMembers);
    
    // Link for deleting members.
    AjaxSubmitLink deleteMemberLink = new AjaxSubmitLink("deleteMemberLink")
{
      // Private method for serialization
      private static final long serialVersionUID = 1L;
      // When link is clicked.
      @Override
      public void onSubmit(AjaxRequestTarget target, Form form) {
        ProjectsSession session =
ProjectBrowserSession.get().getProjectsSession();
        ProjectsModel model = session.getProjectsModel();
        model.removeMembers(model.getMemberSelection());
        ModalWindow modalWindow = session.getModalWindow();
        modalWindow.close(target);
        modalWindow.show(target);
      }
    };
    projectForm.add(deleteMemberLink);

Thank you in advance for any guidance you may have on this issue.

-- 
View this message in context: 
http://www.nabble.com/Updating-a-ListMultipleChoice-within-a-Modal-Window-tp18859154p18859154.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to