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);
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);