You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org> on 2011/05/12 20:41:47 UTC
[jira] [Commented] (EXTCDI-175) introduce @ViewParam annotation for
page beans
[ https://issues.apache.org/jira/browse/EXTCDI-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032571#comment-13032571 ]
Gerhard Petracek commented on EXTCDI-175:
-----------------------------------------
that's more or less our original @RequestParameter idea.
'name' could be optional -> the name of the field is auto. the view-param.-name
we have to come up with a nice approach for converters. imo we will need custom meta-annotations which provide information for the converter.
e.g.
@RequestParam
@CustomDateConverter(pattern = "dd.MM.yyyy")
private Date date;
@Target({TYPE, METHOD})
@Retention(RUNTIME)
@Documented
@CodiFacesConverter(CustomDateConverterImpl.class)
public @interface CustomDateConverter
{
String pattern();
}
we don't need such an annotation for validators - we can use bv (if present)
> introduce @ViewParam annotation for page beans
> ----------------------------------------------
>
> Key: EXTCDI-175
> URL: https://issues.apache.org/jira/browse/EXTCDI-175
> Project: MyFaces CODI
> Issue Type: New Feature
> Reporter: Mark Struberg
>
> When using the ViewConfig in CODI we not only get type safe navigation but also know the 'connection' between views and their backing beans. We already support annotations like @PreRenderView and likes for such beans.
> We should also support the direct annotation of view parameters directly in the backing beans.
> instead of declaring the view parameters in the xhtml:
> <f:metadata>
> <f:viewParam id="versionParam" name="version" value="#{backingbean.versionString}" required="false"/>
> <f:viewParam id="searchString" name="s" value="#{backingbean.searchString}" required="false"/>
> </f:metadata>
> we can maybe use an annotation directly in the backing bean:
> @Named
> @RequestScoped
> public class Backingbean {
> @ViewParam(required=false, name="version")
> private String versionString;
> @ViewParam(required=false, name="s")
> private String searchString;
> @PreRenderView
> private void dosomeinit() {
> ...
> }
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira