[
https://issues.apache.org/jira/browse/WICKET-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463324
]
Johan Compagner commented on WICKET-197:
----------------------------------------
the only thing that is see a value to this for the core is the StatelessLink
that could have a method called getParamaterMap() or something where developers
can return a param,value combo's which are then appended to the url
and then that map also will have the values when the link is clicked.
So they can use it there as there model data.
For other components i don't see much usage. But maybe we can make a generic
interface that statelesslink implements that others can also use.
But it is i guess pure for links. Forms can already do that by just adding
hidden a hidden field component yourself. So why do there extra fuzzy work.
But a client state saving thing where we only add stuff that the component
hierarchy contributes to is maybe a good idea.
That is then stored in the hidden field. Then with on submit the page is
created and the data is inserted back into the component again.
Then we don't serialize the component structure but only the data that is
behind the component that the developers wants to contribute.
The biggest problem is then that we need to rewrite all the links to submit a
form......
> 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