Thank you so much Josh, your solution works great!  It's also easy to
understand.

Thanks again,
Paul



Josh Canfield wrote:
> 
> I whipped something up that will allow you to only submit the form
> when the link is clicked.
> 
> Add this to your form containing the grid to keep track of the page
>     <t:hidden t:id="page"/>
> 
> Add this to your page:
> 
> @Property
> private int _page;
> 
> @Component
> private Grid _grid;
> 
> void onSuccess() {
>         _grid.setCurrentPage(_page);
> }
> 
> Add this javascript to the page after the grid.
> 
> <script type="text/javascript">
>     $$('.t-data-grid-pager a').each(function(a) {
>         a.observe("click", function(e) {
>             e.stop();
>             // parse out the page number.
>             var page = a.href.replace(/^.*pager\/(\d+)$/, "$1");
>             var form = $('personForm');
>             // Hidden doesn't include the id so find by name
>             var pageField = form.select("[name='page']")[0];
>             pageField.value = page;
> 
>             form.submit();
>         });
>     });
> </script>
> 
> Good Luck,
> Josh
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Saving-state-when-changing-grid-pages-tp28682342p28694125.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to