Andre,
Line 41 opens the dialog. The object ID of the page is the same there, on line 6 where the dialog is constructed as well as in the dialog once it opens. When the dialog closes and we get to line 11, the ID has changed and the component model does not have the changes that were made in the dialog. The request target at line 11 has the new page object ID as well.
  Thanks for looking at this,
    Scott

  1. private void addFilterBtn( final WebMarkupContainer radioListArea
     )  {
  2.      final ModalWindow modalFilterDialog = new ModalWindow(
     "filterDialog" );
  3.      add( modalFilterDialog );
  4.      modalFilterDialog.setPageCreator(new
     ModalWindow.PageCreator()    {
  5.          public Page createPage()        {
  6. _*return new RadioListFilterDialog(
     RadioListPage.this.getPageReference(), modalFilterDialog);*_
  7.          }
  8.      });
  9. modalFilterDialog.setWindowClosedCallback(new
     ModalWindow.WindowClosedCallback()    {
 10.          public void onClose(AjaxRequestTarget target)        {
 11. *_refreshRadioListAreaResponse( target );_*
 12. **}
 13.      });
 14. modalFilterDialog.setCloseButtonCallback(new
     ModalWindow.CloseButtonCallback()    {
 15.          public boolean onCloseButtonClicked(AjaxRequestTarget target)
 16.          {
 17.            refreshRadioListAreaResponse( target );
 18.            return true;
 19.          }
 20.      });
 21.
 22.      // filter button in header
 23.      final WebMarkupContainer filterBtn = new WebMarkupContainer(
     "filterbtn" )    {
 24.        private static final long serialVersionUID = 1L;
 25.        @Override
 26.        public void onComponentTag(ComponentTag tag)      {
 27.          // add onclick attribute to the button with this AJAX
     call to Wicket
 28.          // passing the URL of the click event behavior
 29.          tag.put("onclick",
     "wicketAjaxGet('"+filterDialogBehavior.getCallbackUrl()+"')");
 30.        }
 31.      };
 32.      // expose AJAX assigned ID for filter button component
 33.      // so we can update it in back behavior below
 34.      filterBtn.setOutputMarkupId( true );
 35.      add( filterBtn );
 36.
 37.      filterDialogBehavior =  new AbstractDefaultAjaxBehavior()    {
 38.        private static final long serialVersionUID = 1L;
 39.        public void respond( AjaxRequestTarget target )      {
 40.          // open filter dialog
 41. *_modalFilterDialog.show(target);_*
 42.        }
 43.      };
 44.      add( filterDialogBehavior );
 45.    }


On 5/27/2011 4:17 AM, Andrea Del Bene wrote:
Hi Scott,

attach onClose() callback code, the problem should be there.
Out app has a WebPage that opens a ModalWindow dialog passing in the page. The dialog allows the user to modify the model of one of the page's components. When the dialog closes and the onClose() callback in the page is called, the object ID of the page has changed and the component model does not have the changes from the dialog.

This is very likely a common Wicket newbie error but I can't find anything about it anywhere. Please help. Let me know if I need to build a simple example to demonstrate this.

  Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to