Have you tried calling fireObservedChange in your set method? That
should make the property persist.

Luke Galea 
Software Development
BlueCat Networks
905-762-5225
 

-----Original Message-----
From: Patrick Saunders [mailto:[EMAIL PROTECTED]] 
Sent: September 25, 2002 7:53 AM
To: [EMAIL PROTECTED]
Subject: [Tapestry-developer] How to 'scroll' through search results ?


Hi There,
I'm happy to say I'm slowly coming to grips with the Tapestry way of
thinking, though I'm at a stage where I'm struggling with trying to make
a component stateful.

The question is really: How do I persist a search result so that the
user can scroll through it.

Given I have a component called VisualSearch. This is a visual component
that has an text box for the keywords and submit button. When I click
'Go' I do the search and the resulting itemList is a property of this
component. 
ie
================
public class VisualSearch extends BaseComponent {

    private String keywords;
    private List   itemList;

    // no code for brevity
    public String getKeywords() { .. }
    public void setKeywords(String s) { .. }
    public List getItemList() {..}
    public void setItemList(List l) {...}
    public  void formSubmit(IRequestCycle cycle){
        // do search and set itemList
    }
======================

That's all good and well. I then have another visual component that
displays an itemList, ie it does a foreach loop and formats output in
nice html. This will most likely be placed on a different page.
======================
public class SearchResult extends BaseComponent {    private List
itemList;
    private Item item;
    private int currPageNumber; // current page of scrollset user is
looking at.
    private int maxPageNumber;  // Maximum page number
    private int itemsPerPage;    // # of items per page. (determines
above two params)

// All  getter/setter methods here.

}
==========================================

What's the best way to do this?
Is it by making the component persistent or is using the Visit object
the only way? ie, by putting the itemList intot he visit object? 
I get the feeling that's what I need to do but I would be extremely
thankful if people could describe how to get components persisting
components like this, or instead tell me I'm way off the garden path..
:-/

Hope this makes a bit of sense. 
Thanks for reading my post.

Regards,
Patrick.

ps. Anyone have a persistent component they could possibly share with
the forum? It would help a lot of newbies.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to