You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ashika Umanga Umagiliya <au...@biggjapan.com> on 2010/01/18 10:58:04 UTC

WicketExtensions : DataTable : Sending 'id's between web pages?

My Domain model has 'Family' which has many 'SubFamily' objects.

I managed to display the 'Family' information using a DataTable in 
'FamilyPage'.
Now I want to do is,when user clicks on a 'Family Id' the 
'SubFamilyPage' should open and display relavant subfamilies in a datatable.
I want to know how this events work together , I am wondering whether I 
have to use HTTP parameters like in JSP pages.

Sorry for my ignorant , I am quite a newbie to Wicket.

Regards.

FamilyPage                 SubFamilesPage
 
|FamiliesTable|          |SubFamilesTable|
|_____________|          |_______________|
| FamilidId 1 |--------->| sub families  |
| FamilidId 1 |          | belong to id 1|


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


Re: WicketExtensions : DataTable : Sending 'id's between web pages?

Posted by Bert <ta...@gmail.com>.
In the onClick() handler of your link, you can call setResponsePage()
with either the id in question, or pass in the full object:

add(new Link("showSubFamily"){
			 private static final long serialVersionUID = 1L;
			 @Override
			 public void onClick() {
				 setResponsePage(new SubFamilyPage(id)); // or:
setResponsePage(new SubFamilyPage(family));
			 }
		 });


Of course, the SubFamilyPage needs a constructor that accepts the used
parameter.

Hope that helped.

Bert

On Mon, Jan 18, 2010 at 10:58, Ashika Umanga Umagiliya
<au...@biggjapan.com> wrote:
> My Domain model has 'Family' which has many 'SubFamily' objects.
>
> I managed to display the 'Family' information using a DataTable in
> 'FamilyPage'.
> Now I want to do is,when user clicks on a 'Family Id' the 'SubFamilyPage'
> should open and display relavant subfamilies in a datatable.
> I want to know how this events work together , I am wondering whether I have
> to use HTTP parameters like in JSP pages.
>
> Sorry for my ignorant , I am quite a newbie to Wicket.
>
> Regards.
>
> FamilyPage                 SubFamilesPage
>
> |FamiliesTable|          |SubFamilesTable|
> |_____________|          |_______________|
> | FamilidId 1 |--------->| sub families  |
> | FamilidId 1 |          | belong to id 1|
>
>
> ---------------------------------------------------------------------
> 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