Discussion:
[Tapestry-developer] detaching persisitent component properties
h***@public.gmane.org
2003-01-02 18:50:16 UTC
Permalink
When we say that a component has a persistant property, it's that exact
component, within that exact page. Another component on the same page, or on
another page, is independent and won't share that persistant property.

Normally, to share information between many pages, you would store the value
persistantly as a property of the Visit.

If you are creating a vertical component (reusable in different applications)
you can create a parameter for the component that you wire to a property of
your visit, or you can bypass Tapestry and store an attribute directly within
the HttpSession, i.e.,

getPage().getRequestCycle().getRequestContext().getSession().setAttribute
("foo", bar);



--
hlship-***@public.gmane.org

http://tapestry.sf.net
Hey all,
I just want to make sure I have this right.....cuz it seems like it's not
working right now.
Can someone give me an example on how to detach persistent component
properties? I believe I have my head around detaching page properties, but
components seem to be giving me grief.
I have a search form component that standard on most pages. I'll like to
retain the user's search criteria in the text field in later pages.
According to the documentation, the component class must implement the
PageDetachListener interface and all properties can be cleared in the
pageDetached() method. I think I've done this correctly.
Here's what I have so far....my component extends BaseComponent and
implements PageDetachListener.
private String searchInput;
public void setSearchInput(String value) {
searchInput = value;
fireObservedChange("searchInput", value);
}
public void pageDetached(PageEvent event) {
playerName = null;
}
Is this all that is required? New users seem to be getting other people's
search criteria. It seems the property isn't being detached properly.
Ideas?
Thanks
Eric
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
https://lists.sourceforge.net/lists/listinfo/tapestry-developer
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Loading...