[
https://issues.apache.org/jira/browse/WICKET-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462690
]
Igor Vaynberg commented on WICKET-197:
--------------------------------------
and some other cons to consider
programming model shift from pojos to beans because state has to be restored
after component has been instantiated
imodel, and things like idataprovider, will also have to be url participants
because they encapsulate state that is opaque to the component
shall the core components implement this, and indeed can they?
my feeling is (fwif) this proposal will introduce a lot of corner usecases we
will have to deal with
perhaps we shall revisit client state again but for the entire page - that can
be tweaked in a manner similar to this by overriding page.getpagemapentry() so
the user can optimize the state exactly like he wants to and do so in code
> Let components contribute state to URLs
> ---------------------------------------
>
> Key: WICKET-197
> URL: https://issues.apache.org/jira/browse/WICKET-197
> Project: Wicket
> Issue Type: New Feature
> Components: wicket
> Reporter: Eelco Hillenius
> Fix For: 2.0
>
>
> The main purpose of this feature request is to let components expose state so
> that it gets carried with client. Such component can implement an interface
> like:
> public interface UrlContributor {
> Map<String,String> getState();
> void setState(Map<String, String> m);
> }
> Wicket would handle the scoping e.g. by prefixing the key/ value pairs with
> something that ids the components.
> The use case is that you get bookmarkable pages that can be statefull *on a
> component level* (rather than page level with PageParameters). For example:
> class PageableFoo extends SomeComponent implements UrlContributor {
> private int currentPage = 0;
> ...
> public ValueMap<String,String> getState() {
> return new ValueMap("page=" + currentPage);
> }
> void setState(ValueMap<String, String> m) {
> currentPage = m.getInt("page", 0);
> }
> }
> Then, "somepath:page=n" would be carried in every URL that points back to the
> page. This combined with the stateless pages/ components functionality and
> issue WICKET-30 gives users of Wicket almost limitless ability of tweaking
> their applications for bookmarkability and server side memory usage.
> To summarize: the goal of this proposal is to bring bookmarkability of state
> like we have with bookmarkable pages with page parameters to the component
> level.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira