Hi

In a Component i create a ModalWindow. To this ModalWindow i add a
Component/Page. In the Constructor i put an reference to an entity. when i
use this reference in the callback of the Modal Window i got two diferent
references. Can this be, bcause the reference in the modal window was
serialized ? How can i find out why the serialization did not work ?



AjaxLink<Void> ajaxButton = new AjaxLink<Void>(){

    onClick(AjaxRequestTarget target){
        MyEntity myEntity = ...;
        showModal(target,entity);
    }

}

public void showModal(AjaxRequestTarget target,MyEntity myEntity){
    WindowClosedCallback windowClosedCallback = new WindowClosedCallback() {
                        private static final long serialVersionUID = 1L;

                        public void onClose(AjaxRequestTarget target) {

                                // this reference 
                                myEntity.save();

                                MyEnclosingPanel.this.refresh(target);
                                
setResponsePage(MyEnclosingPanel.this.getPage());
                                
                        }
    };

    
    Panel panel = new MyPanel(myEntity)

    ModalWindow modalWindow = new ModalWindow();
    modalWindow.setWindowClosedCallback(windowClosedCallback);
    modalWindow.show(panel, target);
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Variables-Assigned-to-ModalWindow-are-not-the-same-as-in-the-Callback-tp4665161.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to