Hi!
> 3) create a new component, which takes the values out of the request,
> and reapplies them either to another component, or the managed bean.
> It could look much like the aliasBean today.
Ok, finally I think this is not that bad idea :-)
It defines the possibilities within the view (which is my main
requirement) and thus makes it easily possible to use all the jsf
functionality.
I propose to also have the possibility to attach converter/validators to it.
So the tag will be something like:
<t:getParam name="urlParamName" value="#{managedBean.property}">
<f:convertNumber
minFractionDigits="2"
groupingUsed="true" />
<f:validateLength maximum="10" minimum="2"/>
</t:getParam>
May I also propose to put all those getParam into a container elemenent
- e.g. getParams
This might make it possible to do e.g.
<t:getParams renderBookmarkLink="true">
<f:facet name="text">
<h:outputText value="link value" />
</f:facet>
<t:getParam name="urlParamName" value="#{managedBean.property}">
<f:convertNumber
minFractionDigits="2"
groupingUsed="true" />
<f:validateLength maximum="10" minimum="2"/>
</t:getParam>
</t:getParams>
This will not only set the parameters to the property in case of a get
request, but will also generate a "bookmark me" link. Using javascript
only a single click will be required to add it to the favorites.
For those not willing to use such links we can provide a way to add the
parameters to the url by using a special navigation entry.
Someone else on the ML mentioned it, but I dont know who it was - sorry.
<navigation-rule>
<navigation-case>
<from-outcome>MyOutcome</from-outcome>
<to-view-id>/Bookmarkable.jsp?param=#{managerBean.property}</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
In this case it is not possible to add a special converter, though one
will be used if its possible to find one for the property-type.
It will only work with <redirect/>, but I'll start fixing
http://issues.apache.org/jira/browse/MYFACES-516 then there should be a
problem with this.
I know, it will work without fixing MYFACES-516 as the page is
"bookmarkable", but I also think that such pages are able in dual mode,
means: with or without previously added request parameters. And we still
have to preserve stuff like messages, locales, etc.
The real link generation should be routed through an interface to make
it possible to create links ala TinyURL, encryption and/or compression.
Looks like this will be a really nice solution.
Lets define who does what ;-)
Ciao,
Mario