You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joseph Pachod <jo...@thomas-daily.de> on 2010/06/03 00:43:30 UTC

Dialog involving multiple pages and a VO: some best practices?

hi

I've recently been wondering about the following use case: an instance of Foo class, used as a detached value object, is edited in a FooEditPage. For some reasons, let's say this page then needs to launch dialogs spanning over different pages. Each of these pages could then change some fields of the VO being passed around.  

how would you handle the Foo instance being given through ? 

in fact, I mainly wonder about the pages' serialization... are there some pitfalls to avoid ?

on a side note, for the "return page" requirement of the dialog, I would just give the calling page on the next one. Something like setResponsePage(new DialogPageX(this, ...));

is this ok ?

thanks in advance
best regards
joseph

RE: Unable to lazily register wicket-event.js - incorrect case?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
It is indeed a brain dead browser or robot that converts URLs to lowercase although there seems to be some SEO theories which seem to advise people to convert all URLs to lowercase - which seems stupid.

I ran into an issue the other day where a Domain registration company couldn't forward to a site I host because the URL contained mixed case - must have had some type of whacko software running there if it only used lowercase.

>the resources are registered via the fully qualified name of the class
>that acts as scope. if we registered them as fqn.tolowercase() then
>there are possibilities of collisions. if the browser chooses to
>ignore case sensitivity of a url then it deserves a 404.
>
>-igor
>
>On Wed, Jun 2, 2010 at 8:40 PM, Chris Colman
><ch...@stepaheadsoftware.com> wrote:
>> Would it be possible to wrap the resource loader code in a try/catch and
>if it fails retry with a lowercase form of the class name?
>>
>>>-----Original Message-----
>>>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>>>Sent: Thursday, 3 June 2010 12:42 PM
>>>To: users@wicket.apache.org
>>>Subject: RE: Unable to lazily register wicket-event.js - incorrect case?
>>>
>>>I did some more analysis:
>>>
>>>One offending User-Agent is 'reported' to be:
>>>
>>>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR
>2.0.50727)
>>>
>>>But the very first request this agent makes, according to matching IP
>>>addresss, is robots.txt so it's probably not really a normal client
>browser
>>>but a robot/spider.
>>>
>>>Another User-Agent is 'reported' to be:
>>>
>>>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
>2.0.50727;
>>>MAXTHON 2.0)
>>>
>>>Not sure if this is actually IE 6 (another robot/spider?) - amazing that
>>>someone is still able to surf the net using that browser.
>>>
>>>
>>>>-----Original Message-----
>>>>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>>>Sent: Thursday, 3 June 2010 12:11 PM
>>>>To: users@wicket.apache.org
>>>>Subject: Re: Unable to lazily register wicket-event.js - incorrect case?
>>>>
>>>>i doubt it was wicket, probably some weird browser that transformed
>>>>the url into lower case before requesting the resource.
>>>>
>>>>-igor
>>>>
>>>>On Wed, Jun 2, 2010 at 7:02 PM, Chris Colman
>>>><ch...@stepaheadsoftware.com> wrote:
>>>>> My logs reveal a rather interesting resource loading error:
>>>>>
>>>>> ERROR - haredResourceRequestTarget - unable to lazily register shared
>>>>> resource
>>>>> org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
>>>>> java.lang.ClassNotFoundException:
>>>>> org.apache.wicket.markup.html.wicketeventreference
>>>>>        at
>>>>>
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>>>>> .java:1387)
>>>>>
>>>>>
>>>>>
>>>>> The request log reveals the cause:
>>>>>
>>>>> Here's a request for wicket-event.js that fails (404):
>>>>>
>>>>> "GET
>>>>> /resources/org.apache.wicket.markup.html.wicketeventreference/wicket-
>eve
>>>>> nt.js HTTP/1.0" 404 952
>>>>>
>>>>> Here's a request for wicket-event.js that succeeds (200):
>>>>>
>>>>> "GET
>>>>> /resources/org.apache.wicket.markup.html.WicketEventReference/wicket-
>eve
>>>>> nt.js HTTP/1.1" 200 2317
>>>>>
>>>>> Note the difference: The case is different for the word
>>>>> [W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
>>>>> Linux server so obviously case will be an issue. This bug probably
>does
>>>>> not reveal itself on a Windows server.
>>>>>
>>>>> Why would wicket make two different types of requests to get the same
>>>>> resource?
>>>>>
>>>>> I'm using only wicket and wicket-extensions, built from sources taken
>>>>> from SVN 1.4.x trunk on May 24, 2010.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Unable to lazily register wicket-event.js - incorrect case?

Posted by Igor Vaynberg <ig...@gmail.com>.
the resources are registered via the fully qualified name of the class
that acts as scope. if we registered them as fqn.tolowercase() then
there are possibilities of collisions. if the browser chooses to
ignore case sensitivity of a url then it deserves a 404.

-igor

On Wed, Jun 2, 2010 at 8:40 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> Would it be possible to wrap the resource loader code in a try/catch and if it fails retry with a lowercase form of the class name?
>
>>-----Original Message-----
>>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>>Sent: Thursday, 3 June 2010 12:42 PM
>>To: users@wicket.apache.org
>>Subject: RE: Unable to lazily register wicket-event.js - incorrect case?
>>
>>I did some more analysis:
>>
>>One offending User-Agent is 'reported' to be:
>>
>>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
>>
>>But the very first request this agent makes, according to matching IP
>>addresss, is robots.txt so it's probably not really a normal client browser
>>but a robot/spider.
>>
>>Another User-Agent is 'reported' to be:
>>
>>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727;
>>MAXTHON 2.0)
>>
>>Not sure if this is actually IE 6 (another robot/spider?) - amazing that
>>someone is still able to surf the net using that browser.
>>
>>
>>>-----Original Message-----
>>>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>>Sent: Thursday, 3 June 2010 12:11 PM
>>>To: users@wicket.apache.org
>>>Subject: Re: Unable to lazily register wicket-event.js - incorrect case?
>>>
>>>i doubt it was wicket, probably some weird browser that transformed
>>>the url into lower case before requesting the resource.
>>>
>>>-igor
>>>
>>>On Wed, Jun 2, 2010 at 7:02 PM, Chris Colman
>>><ch...@stepaheadsoftware.com> wrote:
>>>> My logs reveal a rather interesting resource loading error:
>>>>
>>>> ERROR - haredResourceRequestTarget - unable to lazily register shared
>>>> resource
>>>> org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
>>>> java.lang.ClassNotFoundException:
>>>> org.apache.wicket.markup.html.wicketeventreference
>>>>        at
>>>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>>>> .java:1387)
>>>>
>>>>
>>>>
>>>> The request log reveals the cause:
>>>>
>>>> Here's a request for wicket-event.js that fails (404):
>>>>
>>>> "GET
>>>> /resources/org.apache.wicket.markup.html.wicketeventreference/wicket-eve
>>>> nt.js HTTP/1.0" 404 952
>>>>
>>>> Here's a request for wicket-event.js that succeeds (200):
>>>>
>>>> "GET
>>>> /resources/org.apache.wicket.markup.html.WicketEventReference/wicket-eve
>>>> nt.js HTTP/1.1" 200 2317
>>>>
>>>> Note the difference: The case is different for the word
>>>> [W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
>>>> Linux server so obviously case will be an issue. This bug probably does
>>>> not reveal itself on a Windows server.
>>>>
>>>> Why would wicket make two different types of requests to get the same
>>>> resource?
>>>>
>>>> I'm using only wicket and wicket-extensions, built from sources taken
>>>> from SVN 1.4.x trunk on May 24, 2010.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: Unable to lazily register wicket-event.js - incorrect case?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Would it be possible to wrap the resource loader code in a try/catch and if it fails retry with a lowercase form of the class name?

>-----Original Message-----
>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>Sent: Thursday, 3 June 2010 12:42 PM
>To: users@wicket.apache.org
>Subject: RE: Unable to lazily register wicket-event.js - incorrect case?
>
>I did some more analysis:
>
>One offending User-Agent is 'reported' to be:
>
>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
>
>But the very first request this agent makes, according to matching IP
>addresss, is robots.txt so it's probably not really a normal client browser
>but a robot/spider.
>
>Another User-Agent is 'reported' to be:
>
>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727;
>MAXTHON 2.0)
>
>Not sure if this is actually IE 6 (another robot/spider?) - amazing that
>someone is still able to surf the net using that browser.
>
>
>>-----Original Message-----
>>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>Sent: Thursday, 3 June 2010 12:11 PM
>>To: users@wicket.apache.org
>>Subject: Re: Unable to lazily register wicket-event.js - incorrect case?
>>
>>i doubt it was wicket, probably some weird browser that transformed
>>the url into lower case before requesting the resource.
>>
>>-igor
>>
>>On Wed, Jun 2, 2010 at 7:02 PM, Chris Colman
>><ch...@stepaheadsoftware.com> wrote:
>>> My logs reveal a rather interesting resource loading error:
>>>
>>> ERROR - haredResourceRequestTarget - unable to lazily register shared
>>> resource
>>> org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
>>> java.lang.ClassNotFoundException:
>>> org.apache.wicket.markup.html.wicketeventreference
>>>        at
>>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>>> .java:1387)
>>>
>>>
>>>
>>> The request log reveals the cause:
>>>
>>> Here's a request for wicket-event.js that fails (404):
>>>
>>> "GET
>>> /resources/org.apache.wicket.markup.html.wicketeventreference/wicket-eve
>>> nt.js HTTP/1.0" 404 952
>>>
>>> Here's a request for wicket-event.js that succeeds (200):
>>>
>>> "GET
>>> /resources/org.apache.wicket.markup.html.WicketEventReference/wicket-eve
>>> nt.js HTTP/1.1" 200 2317
>>>
>>> Note the difference: The case is different for the word
>>> [W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
>>> Linux server so obviously case will be an issue. This bug probably does
>>> not reveal itself on a Windows server.
>>>
>>> Why would wicket make two different types of requests to get the same
>>> resource?
>>>
>>> I'm using only wicket and wicket-extensions, built from sources taken
>>> from SVN 1.4.x trunk on May 24, 2010.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>For additional commands, e-mail: users-help@wicket.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


RE: Unable to lazily register wicket-event.js - incorrect case?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I did some more analysis: 

One offending User-Agent is 'reported' to be:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)

But the very first request this agent makes, according to matching IP addresss, is robots.txt so it's probably not really a normal client browser but a robot/spider.

Another User-Agent is 'reported' to be:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; MAXTHON 2.0)

Not sure if this is actually IE 6 (another robot/spider?) - amazing that someone is still able to surf the net using that browser.


>-----Original Message-----
>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>Sent: Thursday, 3 June 2010 12:11 PM
>To: users@wicket.apache.org
>Subject: Re: Unable to lazily register wicket-event.js - incorrect case?
>
>i doubt it was wicket, probably some weird browser that transformed
>the url into lower case before requesting the resource.
>
>-igor
>
>On Wed, Jun 2, 2010 at 7:02 PM, Chris Colman
><ch...@stepaheadsoftware.com> wrote:
>> My logs reveal a rather interesting resource loading error:
>>
>> ERROR - haredResourceRequestTarget - unable to lazily register shared
>> resource
>> org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
>> java.lang.ClassNotFoundException:
>> org.apache.wicket.markup.html.wicketeventreference
>>        at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>> .java:1387)
>>
>>
>>
>> The request log reveals the cause:
>>
>> Here's a request for wicket-event.js that fails (404):
>>
>> "GET
>> /resources/org.apache.wicket.markup.html.wicketeventreference/wicket-eve
>> nt.js HTTP/1.0" 404 952
>>
>> Here's a request for wicket-event.js that succeeds (200):
>>
>> "GET
>> /resources/org.apache.wicket.markup.html.WicketEventReference/wicket-eve
>> nt.js HTTP/1.1" 200 2317
>>
>> Note the difference: The case is different for the word
>> [W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
>> Linux server so obviously case will be an issue. This bug probably does
>> not reveal itself on a Windows server.
>>
>> Why would wicket make two different types of requests to get the same
>> resource?
>>
>> I'm using only wicket and wicket-extensions, built from sources taken
>> from SVN 1.4.x trunk on May 24, 2010.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Unable to lazily register wicket-event.js - incorrect case?

Posted by Igor Vaynberg <ig...@gmail.com>.
i doubt it was wicket, probably some weird browser that transformed
the url into lower case before requesting the resource.

-igor

On Wed, Jun 2, 2010 at 7:02 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> My logs reveal a rather interesting resource loading error:
>
> ERROR - haredResourceRequestTarget - unable to lazily register shared
> resource
> org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
> java.lang.ClassNotFoundException:
> org.apache.wicket.markup.html.wicketeventreference
>        at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
> .java:1387)
>
>
>
> The request log reveals the cause:
>
> Here's a request for wicket-event.js that fails (404):
>
> "GET
> /resources/org.apache.wicket.markup.html.wicketeventreference/wicket-eve
> nt.js HTTP/1.0" 404 952
>
> Here's a request for wicket-event.js that succeeds (200):
>
> "GET
> /resources/org.apache.wicket.markup.html.WicketEventReference/wicket-eve
> nt.js HTTP/1.1" 200 2317
>
> Note the difference: The case is different for the word
> [W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
> Linux server so obviously case will be an issue. This bug probably does
> not reveal itself on a Windows server.
>
> Why would wicket make two different types of requests to get the same
> resource?
>
> I'm using only wicket and wicket-extensions, built from sources taken
> from SVN 1.4.x trunk on May 24, 2010.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Unable to lazily register wicket-event.js - incorrect case?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
My logs reveal a rather interesting resource loading error:

ERROR - haredResourceRequestTarget - unable to lazily register shared
resource
org.apache.wicket.markup.html.wicketeventreference/wicket-event.js
java.lang.ClassNotFoundException:
org.apache.wicket.markup.html.wicketeventreference
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1387)



The request log reveals the cause:

Here's a request for wicket-event.js that fails (404):

"GET
/resources/org.apache.wicket.markup.html.wicketeventreference/wicket-eve
nt.js HTTP/1.0" 404 952

Here's a request for wicket-event.js that succeeds (200):

"GET
/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-eve
nt.js HTTP/1.1" 200 2317

Note the difference: The case is different for the word
[W|w]icket[E|e]vent[R|r]eference in each case. Tomcat is running on a
Linux server so obviously case will be an issue. This bug probably does
not reveal itself on a Windows server.

Why would wicket make two different types of requests to get the same
resource?

I'm using only wicket and wicket-extensions, built from sources taken
from SVN 1.4.x trunk on May 24, 2010.

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


Re: SV: Dialog involving multiple pages and a VO: some best practices?

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Wilhelmsen Tor Iver wrote:
>> I've recently been wondering about the following use case: an instance
>> of Foo class, used as a detached value object, is edited in a
>> FooEditPage. For some reasons, let's say this page then needs to launch
>> dialogs spanning over different pages. Each of these pages could then
>> change some fields of the VO being passed around.
>>     
>
> Sharing between pages is easier done by placing it in the Session which is accessible from all of them.
>
> - Tor Iver
>   
Thanks for the answer.

However, Mauro put forward some of the issues it raised, the one with 2 
browser windows.

I would add as well that would have to care about the cleanup of this 
stuff, because having it session's scoped would be enough IMHO (if the 
user is editing heavily), it would have to be linked to the action 
completeness.
Then, putting the VO directly in the Session spoils the memory 
consumption, so you would probably, on top of that, want to put it in 
some dedicated datastore.

In the end, I feel it to be quite error prone. Did you try it already ? 
I would welcome some feedback :$

:)

cheers
joseph



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


SV: Dialog involving multiple pages and a VO: some best practices?

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> I've recently been wondering about the following use case: an instance
> of Foo class, used as a detached value object, is edited in a
> FooEditPage. For some reasons, let's say this page then needs to launch
> dialogs spanning over different pages. Each of these pages could then
> change some fields of the VO being passed around.

Sharing between pages is easier done by placing it in the Session which is accessible from all of them.

- Tor Iver

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Mauro Ciancio wrote:
> Hi,
>
> On Wed, Jun 2, 2010 at 7:43 PM, Joseph Pachod
> <jo...@thomas-daily.de> wrote:
>   
>> I've recently been wondering about the following use case: an instance of Foo class,
>> used as a detached value object, is edited in a FooEditPage. For some reasons, let's
>> say this page then needs to launch dialogs spanning over different pages. Each of
>> these pages could then change some fields of the VO being passed around.
>>     
>
>   Have you taken a look to wicket-wizards?
> http://www.wicket-library.com/wicket-examples/wizard/
>   
not yet ;)

I thought this wizard widget wouldn't spread on multiple pages. I'll 
look closer then :)
>> in fact, I mainly wonder about the pages' serialization... are there some pitfalls to avoid ?
>>     
>
>   If you have to track the object's state through several pages,
> you'll need a serializable
> object, because reloading it using a LDM in every request will throw
> away all the changes
> made before.
>   So, your Foo must implement Serializable, or you could create some
> proxy object that
> tracks the changes and when the user finish the editing process, apply
> the changes to
> the real model object.
>   
yep, for sure the VO is Serializable.

But is there any "dragon lurking" there, with some return page de 
serialized instance's references pointing to some other reference that 
the one behind the current model being given around ?


thanks a lot !

best
joseph

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Mauro Ciancio <ma...@gmail.com>.
Hi,

On Wed, Jun 2, 2010 at 7:43 PM, Joseph Pachod
<jo...@thomas-daily.de> wrote:
> I've recently been wondering about the following use case: an instance of Foo class,
> used as a detached value object, is edited in a FooEditPage. For some reasons, let's
> say this page then needs to launch dialogs spanning over different pages. Each of
> these pages could then change some fields of the VO being passed around.

  Have you taken a look to wicket-wizards?
http://www.wicket-library.com/wicket-examples/wizard/

> in fact, I mainly wonder about the pages' serialization... are there some pitfalls to avoid ?

  If you have to track the object's state through several pages,
you'll need a serializable
object, because reloading it using a LDM in every request will throw
away all the changes
made before.
  So, your Foo must implement Serializable, or you could create some
proxy object that
tracks the changes and when the user finish the editing process, apply
the changes to
the real model object.

On Thu, Jun 3, 2010 at 9:19 AM, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
> Sharing between pages is easier done by placing it in the Session which is accessible
> from all of them.

  I think that storing a model object in the session is not a good
choice; if the user opens
two browser windows, what will happen?

Regards.
-- 
Mauro Ciancio <maurociancio at gmail dot com>

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Igor Vaynberg wrote:
> obviously you have to know what you are passing around. you shouldnt
> pass around objects that link to page instances, such as anonymous
> classes of models.
>
> -igor
>   
if that's all, then all fine for me

quite different from what I had in mind about different references to 
the logically same object being potentially used in the different pages.

thanks a lot

++
joseph

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Igor Vaynberg <ig...@gmail.com>.
obviously you have to know what you are passing around. you shouldnt
pass around objects that link to page instances, such as anonymous
classes of models.

-igor

On Fri, Jun 4, 2010 at 2:04 AM, Joseph Pachod <jp...@thomas-daily.de> wrote:
> Igor Vaynberg wrote:
>>
>> usually i simply allow pages to take models of whatever it is they
>> need, just like any other component. in case of a dto being passed
>> around you can simply use the default model: new Model<Dto>(new
>> Dto()); and pass that to any page. that way the page does not need to
>> worry about where the objects comes from or how to store it.
>>
>> -igor
>
> As answered to Maruo, is there any "dragon lurking" there, with some return
> page de serialized instance's references pointing to some other reference
> that the one behind the current model being given around ?
>
> I was somehow under the impression it was kind of risky...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Igor Vaynberg wrote:
> usually i simply allow pages to take models of whatever it is they
> need, just like any other component. in case of a dto being passed
> around you can simply use the default model: new Model<Dto>(new
> Dto()); and pass that to any page. that way the page does not need to
> worry about where the objects comes from or how to store it.
>
> -igor
As answered to Maruo, is there any "dragon lurking" there, with some 
return page de serialized instance's references pointing to some other 
reference that the one behind the current model being given around ?

I was somehow under the impression it was kind of risky...

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


Re: Dialog involving multiple pages and a VO: some best practices?

Posted by Igor Vaynberg <ig...@gmail.com>.
usually i simply allow pages to take models of whatever it is they
need, just like any other component. in case of a dto being passed
around you can simply use the default model: new Model<Dto>(new
Dto()); and pass that to any page. that way the page does not need to
worry about where the objects comes from or how to store it.

-igor

On Wed, Jun 2, 2010 at 3:43 PM, Joseph Pachod
<jo...@thomas-daily.de> wrote:
> hi
>
> I've recently been wondering about the following use case: an instance of Foo class, used as a detached value object, is edited in a FooEditPage. For some reasons, let's say this page then needs to launch dialogs spanning over different pages. Each of these pages could then change some fields of the VO being passed around.
>
> how would you handle the Foo instance being given through ?
>
> in fact, I mainly wonder about the pages' serialization... are there some pitfalls to avoid ?
>
> on a side note, for the "return page" requirement of the dialog, I would just give the calling page on the next one. Something like setResponsePage(new DialogPageX(this, ...));
>
> is this ok ?
>
> thanks in advance
> best regards
> joseph

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