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 2010/11/27 00:55:14 UTC

[jira] Created: (EXTCDI-86) alternative approach for @PageBean

alternative approach for @PageBean
----------------------------------

                 Key: EXTCDI-86
                 URL: https://issues.apache.org/jira/browse/EXTCDI-86
             Project: MyFaces CODI
          Issue Type: Improvement
          Components: JEE-JSF12-Module, JEE-JSF20-Module
    Affects Versions: 0.9.0
            Reporter: Gerhard Petracek


within type-safe view configs it's possible to define page-beans via @PageBean.
so there is a central place for all page-bean definitions.

if users would like to define it directly at the bean, it should be possible to use the existing @View annotation for the definition.
attention: @View is an interceptor - in case of a class level use it shouldn't be used as interceptor.

example:

@View(DemoPage.class)
@Model
public class DemoPageBean
{
    @PreRenderView
    protected void preRenderView()
    {
        //...
    }
}

... means - as soon as the page defined by DemoPage.class should be used the methods with the view-controller annotations should be invoked (at the corresponding time).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (EXTCDI-86) alternative approach for @PageBean

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/EXTCDI-86?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerhard Petracek resolved EXTCDI-86.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.1

> alternative approach for @PageBean
> ----------------------------------
>
>                 Key: EXTCDI-86
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-86
>             Project: MyFaces CODI
>          Issue Type: Improvement
>          Components: JEE-JSF12-Module, JEE-JSF20-Module
>    Affects Versions: 0.9.0
>            Reporter: Gerhard Petracek
>             Fix For: 0.9.1
>
>
> within type-safe view configs it's possible to define page-beans via @PageBean.
> so there is a central place for all page-bean definitions.
> if users would like to define it directly at the bean, it should be possible to use the existing @View annotation for the definition.
> attention: @View is an interceptor - in case of a class level use it shouldn't be used as interceptor.
> example:
> @View(DemoPage.class)
> @Model
> public class DemoPageBean
> {
>     @PreRenderView
>     protected void preRenderView()
>     {
>         //...
>     }
> }
> ... means - as soon as the page defined by DemoPage.class should be used the methods with the view-controller annotations should be invoked (at the corresponding time).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EXTCDI-86) alternative approach for @PageBean

Posted by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/EXTCDI-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12936135#action_12936135 ] 

Gerhard Petracek commented on EXTCDI-86:
----------------------------------------

as an alternative to @View we could use something like @PageBean(view =DemoPage.class) - that would be more verbose and error-prone for users because it isn't possible to see the difference between #value and #view

> alternative approach for @PageBean
> ----------------------------------
>
>                 Key: EXTCDI-86
>                 URL: https://issues.apache.org/jira/browse/EXTCDI-86
>             Project: MyFaces CODI
>          Issue Type: Improvement
>          Components: JEE-JSF12-Module, JEE-JSF20-Module
>    Affects Versions: 0.9.0
>            Reporter: Gerhard Petracek
>             Fix For: 0.9.1
>
>
> within type-safe view configs it's possible to define page-beans via @PageBean.
> so there is a central place for all page-bean definitions.
> if users would like to define it directly at the bean, it should be possible to use the existing @View annotation for the definition.
> attention: @View is an interceptor - in case of a class level use it shouldn't be used as interceptor.
> example:
> @View(DemoPage.class)
> @Model
> public class DemoPageBean
> {
>     @PreRenderView
>     protected void preRenderView()
>     {
>         //...
>     }
> }
> ... means - as soon as the page defined by DemoPage.class should be used the methods with the view-controller annotations should be invoked (at the corresponding time).
> hint: we shouldn't use @PageBean at the bean itself because the annotation has to use
>   Class value();
> instead of
>   Class<? extends ViewConfig>[] value();
> (which is available at @View and allows a compile-time check!)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.