new Link("editLink") {
    protected void onClick() {
        Book book = (Book)getParent().getModelObject();
        setResponsePage(new EditBook(book));
    }
}

Should work.

Martijn

On 3/20/06, ali <[EMAIL PROTECTED]> wrote:
On Mon, 20 Mar 2006 14:18:48 +0530, Johan Compagner <[EMAIL PROTECTED]>
wrote:
can i do like :

class BookList extends WebPage {

        public BookList() {

                add(new ListView("booksList", booksList){

                        public void populateItem(ListItem item) {

                                add(new Link("editLink") {
                                        EditBook page = EditBook.getInstance();
                                        page.setModel(new CompoundPropertyModel(item.getModelObject())); //or
line also move to page
                                        setResponsePage(page);
                        }
                });
        }
}

if i can do this then what effects do it put in on end-user of app?

> you can reuse pages just fine for one session ofcourse if you want.
>
> So in youre BookList you hold on to an internal page BookDetails or
> EditBook
> page
> And when you click on a view/edit link you just reuse that page.
>
> I wouldn't share pages across sessions.
>
> johan
>
>
> On 3/20/06, ali <[EMAIL PROTECTED]> wrote:
>>
>> i am new in wicket , it's correct that we tell
>>
>> 1- always use getPageFactory.newPage() instead "new".
>>
>> 2- if a user view/edit 4 book in its session , for him/her created 4
>> BookDetails and 4 EditBook page object.(why this needed)
>>
>> do we can define page be singleton in level of handler thread or session
>> (i remember ThreadLocal)? so that like swing only once EditBook or
>> BookDetails pages instanced and for next book only needed that call on
>> them setBook(booK);
>>
>> refrence to these pages can keep in session and also they can
>>
>> or maybe i must more read examples and docs
>>
>> --
>> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Cast your final vote for Wicket in the SourceForge.net 2006 Community Choice Awards!
http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php

Reply via email to