[Wicket-user] Page class instanciation in a tree navigated application

2007-02-11 Thread Natto Lover
Hi.

This is my 3rd day with Wicket.  I really like Wicket so far.
I am looking through the docs and examples and their source,
but came to a couple of questions.

I want to know how the code will look like if I applied Wicket to
one of my web apps.  I have a domain model with lots of objects,
too many to hold all of them on memory, and a tree view to navigate
through them.  I use html frames and show the nav tree on the left
and the node page on the right.

In my existing implementation, each node page has its URL.
The URL identifies the type of the page, and the instance within
the domain model.

I found out that in Wicket examples, URLs to pages are always created
after creating a page object and registering it to the pagemap.
Sometimes the URL does not exist until the link is clicked.

My questions are:
(1)  Can I create URLs without instantiating the page objects?
(2) For an application with lots of page objects of the same page class
 but pointing to different domain object instances, how is the Wicket
 way to create URLs for those different instances?
 Or should I simply wait until a link is actually clicked, and within
 the onClick handler, instantiate a page object, and call
 setResponsePage(theTargetPage) or something ?
 If so, how can I avoid creating duplicate instances for the same
 domain object when the user clicks the link for the same instance
 for multiple times?

Thanks.
---
Natto is Japanese Food.
I chose it for my alias.


-- 
___
Search for products and services at: 
http://search.mail.com

Powered by Outblaze

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Page class instanciation in a tree navigated application

2007-02-11 Thread Igor Vaynberg

On 2/11/07, Natto Lover [EMAIL PROTECTED] wrote:


My questions are:
(1)  Can I create URLs without instantiating the page objects?



wicket has bookmarkable pages ( a page that has a default constructor or
page(PageParameters) constructor ). you can create a url for this page
without creating an instance by using requestcycle.urlfor(Class pageClass,
PageParameters params) method

(2) For an application with lots of page objects of the same page class

but pointing to different domain object instances, how is the Wicket
way to create URLs for those different instances?



you would put this object id into the pageparameters structure before
calling urlfor, then retrieve it again in your page's constructor. this way
of working is similar to other frameworks where you pass data on the url.

Or should I simply wait until a link is actually clicked, and within

the onClick handler, instantiate a page object, and call
setResponsePage(theTargetPage) or something ?



usually this would be the way to go, but because you are dealing with frames
and want the page to in another frame you cannot.

If so, how can I avoid creating duplicate instances for the same

domain object when the user clicks the link for the same instance
for multiple times?



not sure what you mean by duplicate instances of domain objects.

also when working with frames dont forget to set a different pagemap for the
pages you will open in the right frame. search our wiki for frames, and see
a frames example in wicket-examples

-igor




Thanks.

---
Natto is Japanese Food.
I chose it for my alias.


--
___
Search for products and services at:
http://search.mail.com

Powered by Outblaze

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user