You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yohan Yudanara <yo...@gmail.com> on 2010/02/16 06:42:30 UTC
[T5.1] Remembering Search Parameter during Changing Page in Grid
Hi..
I'd like to ask a question which seems to be basic question, but I
can't find it on this mailing list archives and wiki.
I have a page with textfield, "search" button, and grid to display
search result:
<t:textfield t:id="searchParam" t:value="searchParam" /> <t:submit
t:id="search" value="Search" />
Let's say the search returned 60 rows, and the grid display the first 25 rows.
If I click link to second page to display next 25 rows, the search
result is displayed correctly if I was using session (not FLASH) to
save searchParam, like this:
@Persist(PersistenceConstants.SESSION)
private String searchParam;
My page class executing search query to return GridDataSource object
on setupRender() method.
My question is:
can I execute above scenario without persisting searchParam in Session ?
Thanks in advance.
Regards,
Yohan Yudanara
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.1] Remembering Search Parameter during Changing Page in Grid
Posted by "Joost Schouten (ml)" <jo...@jsportal.com>.
Use the code below. It will not use a session and encode the value in
your urls.
Cheers,
Joost
private String searchTerm;
@OnEvent(value = EventConstants.ACTIVATE)
private void activate(String searchTerm) {
this.searchTerm = searchTerm;
}
@OnEvent(value = EventConstants.PASSIVATE)
private Object passivate() {
return this.searchTerm;
}
Muhammad Mohsen wrote:
> I'm no expert in tapestry and I'm not sure if I got your question right, but
> either ways I'll try to help.
>
> 1.try using use "@Persist" without specifying that it's a session scoped
> persistence. (assuming you are using tapestry 5)
> 2.refer to the "hilo" tutorial here on
> tapestry<http://tapestry.apache.org/tapestry5.1/tutorial1/hilo.html>.
> See it through till the end, I'm sure you'll find what you're looking for
> god willing.
>
> On Tue, Feb 16, 2010 at 7:42 AM, Yohan Yudanara <yo...@gmail.com>wrote:
>
>
>> Hi..
>>
>> I'd like to ask a question which seems to be basic question, but I
>> can't find it on this mailing list archives and wiki.
>>
>> I have a page with textfield, "search" button, and grid to display
>> search result:
>> <t:textfield t:id="searchParam" t:value="searchParam" /> <t:submit
>> t:id="search" value="Search" />
>>
>> Let's say the search returned 60 rows, and the grid display the first 25
>> rows.
>> If I click link to second page to display next 25 rows, the search
>> result is displayed correctly if I was using session (not FLASH) to
>> save searchParam, like this:
>> @Persist(PersistenceConstants.SESSION)
>> private String searchParam;
>>
>> My page class executing search query to return GridDataSource object
>> on setupRender() method.
>>
>> My question is:
>> can I execute above scenario without persisting searchParam in Session ?
>>
>> Thanks in advance.
>>
>> Regards,
>> Yohan Yudanara
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.1] Remembering Search Parameter during Changing Page in Grid
Posted by Muhammad Mohsen <m....@gmail.com>.
I'm no expert in tapestry and I'm not sure if I got your question right, but
either ways I'll try to help.
1.try using use "@Persist" without specifying that it's a session scoped
persistence. (assuming you are using tapestry 5)
2.refer to the "hilo" tutorial here on
tapestry<http://tapestry.apache.org/tapestry5.1/tutorial1/hilo.html>.
See it through till the end, I'm sure you'll find what you're looking for
god willing.
On Tue, Feb 16, 2010 at 7:42 AM, Yohan Yudanara <yo...@gmail.com>wrote:
> Hi..
>
> I'd like to ask a question which seems to be basic question, but I
> can't find it on this mailing list archives and wiki.
>
> I have a page with textfield, "search" button, and grid to display
> search result:
> <t:textfield t:id="searchParam" t:value="searchParam" /> <t:submit
> t:id="search" value="Search" />
>
> Let's say the search returned 60 rows, and the grid display the first 25
> rows.
> If I click link to second page to display next 25 rows, the search
> result is displayed correctly if I was using session (not FLASH) to
> save searchParam, like this:
> @Persist(PersistenceConstants.SESSION)
> private String searchParam;
>
> My page class executing search query to return GridDataSource object
> on setupRender() method.
>
> My question is:
> can I execute above scenario without persisting searchParam in Session ?
>
> Thanks in advance.
>
> Regards,
> Yohan Yudanara
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Muhammad Mohsen Hussien
Jr. Java Software Engineer
HP Enterprise Services
Re: [T5.1] Remembering Search Parameter during Changing Page in Grid
Posted by Yohan Yudanara <yo...@gmail.com>.
Thanks a lot for the solution...
It works..
On Wed, Feb 17, 2010 at 2:10 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Tue, 16 Feb 2010 03:42:30 -0200, Yohan Yudanara
> <yo...@gmail.com> wrote:
>
>> Hi..
>
> Hi!
>
>> My question is:
>> can I execute above scenario without persisting searchParam in Session ?
>
> Use the search text as the page activation context. Something like:
>
> public void onActivate(String search) {
> searchParam = search;
> }
>
> public String onPassivate() {
> return searchParam;
> }
>
> This way, it's like you're persisting the search param in the URL.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.1] Remembering Search Parameter during Changing Page in Grid
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 16 Feb 2010 03:42:30 -0200, Yohan Yudanara
<yo...@gmail.com> wrote:
> Hi..
Hi!
> My question is:
> can I execute above scenario without persisting searchParam in Session ?
Use the search text as the page activation context. Something like:
public void onActivate(String search) {
searchParam = search;
}
public String onPassivate() {
return searchParam;
}
This way, it's like you're persisting the search param in the URL.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org