Re: Variables Assigned to ModalWindow are not the same as in the Callback

2014-04-08 Thread arnzel
The problem is, that this classes are hibernate entities. so they have to be
serializable



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Variables-Assigned-to-ModalWindow-are-not-the-same-as-in-the-Callback-tp4665161p4665290.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



Re: Variables Assigned to ModalWindow are not the same as in the Callback

2014-04-08 Thread Ernesto Reinaldo Barreiro
http://stackoverflow.com/questions/18741445/hibernate-entity-serializable


On Tue, Apr 8, 2014 at 3:35 PM, arnzel arne_zela...@gmx.de wrote:

 The problem is, that this classes are hibernate entities. so they have to
 be
 serializable



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Variables-Assigned-to-ModalWindow-are-not-the-same-as-in-the-Callback-tp4665161p4665290.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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: Variables Assigned to ModalWindow are not the same as in the Callback

2014-04-01 Thread Martin Grigorov
Hi,

Yes.
I believe the problem comes because the entity is deserialized.
The easier way to check is to remove java.io.Serializable from its
interfaces. Wicket will tell you when it tries to serialize it with a
detailed exception message.

Martin Grigorov
Wicket Training and Consulting


On Thu, Mar 27, 2014 at 5:58 PM, arnzel arne_zela...@gmx.de wrote:

 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 ?



 AjaxLinkVoid ajaxButton = new AjaxLinkVoid(){

 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