You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Guy Bashan (JIRA)" <de...@myfaces.apache.org> on 2006/01/11 15:58:20 UTC

[jira] Created: (MYFACES-1019) JSF initial state

JSF initial state
-----------------

         Key: MYFACES-1019
         URL: http://issues.apache.org/jira/browse/MYFACES-1019
     Project: MyFaces
        Type: Improvement
  Components: Implementation  
    Versions: 1.1.1    
 Environment: Linux, WindowXP, JDeveloper
    Reporter: Guy Bashan


I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
It seems like JSF does not give any solution to initial state problem.
A simple example:
I want to show a simple table that is being updated according to several filters.
The table should be shown with initial data according to filters selections.
The actions that I am doing are:
1) To show initially the table, on the backing bean constructor I am loading the table data.
2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.

This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.

This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
For example, I would expect that in addition to the constructor there will be 2 additional methods:
1) init() - Will be called when screen first loads.
2) reinit() - Will be called when screen is reloaded.

Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (MYFACES-1019) JSF initial state

Posted by Mike Kienenberger <mk...@gmail.com>.
Part of the reason I was so short in my reply rather than talking
about shale or jsf-spring is that I don't think we should be
encouraging users to post questions in the issue tracker.

I don't think you should be rewarding him for asking there rather than
asking on the list again  :)



On 1/11/06, Werner Punz (JIRA) <de...@myfaces.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/MYFACES-1019?page=comments#action_12362478 ]
>
> Werner Punz commented on MYFACES-1019:
> --------------------------------------
>
> As Martin has pointed out, this is more of a usage problem, and definitely not scope of a myfaces bug.
> The solution is the shale view controller, if you are not familiar with that one, also servlet filters work, or phase listeners.
> (although phase listeners can only trigger an initial state securely not an ending one, due to the possibiltiy of skipping additional phases programmatically)
>
> Not having such things in normal backing beans is probably a design decision, as it seems the JSF specificators kept the syntax of the backing beans as POJO as possible, having such callback would break the POJO paradigm.
>
> (Shale for instance uses to my knowledge a special View Controller interface which introduces the callbacks into the backing bean)
>
>
> > JSF initial state
> > -----------------
> >
> >          Key: MYFACES-1019
> >          URL: http://issues.apache.org/jira/browse/MYFACES-1019
> >      Project: MyFaces
> >         Type: Improvement
> >   Components: Implementation
> >     Versions: 1.1.1
> >  Environment: Linux, WindowXP, JDeveloper
> >     Reporter: Guy Bashan
>
> >
> > I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> > It seems like JSF does not give any solution to initial state problem.
> > A simple example:
> > I want to show a simple table that is being updated according to several filters.
> > The table should be shown with initial data according to filters selections.
> > The actions that I am doing are:
> > 1) To show initially the table, on the backing bean constructor I am loading the table data.
> > 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> > This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> > This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> > For example, I would expect that in addition to the constructor there will be 2 additional methods:
> > 1) init() - Will be called when screen first loads.
> > 2) reinit() - Will be called when screen is reloaded.
> > Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> > By the way, I have to initialize data dynamically and not using managed properties.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>

[jira] Closed: (MYFACES-1019) JSF initial state

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-1019?page=all ]
     
Mike Kienenberger closed MYFACES-1019:
--------------------------------------

    Resolution: Invalid

I'm sorry to hear that you are having trouble finding answer on the forums, but the bug database isn't for asking questions.   It's for reporting bugs.

Try asking again, or try a different forum (Sun's JSF forum, the Sun RI users mailing list, MyFaces users mailing list, facelets, Shale, etc).

> JSF initial state
> -----------------
>
>          Key: MYFACES-1019
>          URL: http://issues.apache.org/jira/browse/MYFACES-1019
>      Project: MyFaces
>         Type: Improvement
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Linux, WindowXP, JDeveloper
>     Reporter: Guy Bashan

>
> I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> It seems like JSF does not give any solution to initial state problem.
> A simple example:
> I want to show a simple table that is being updated according to several filters.
> The table should be shown with initial data according to filters selections.
> The actions that I am doing are:
> 1) To show initially the table, on the backing bean constructor I am loading the table data.
> 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> For example, I would expect that in addition to the constructor there will be 2 additional methods:
> 1) init() - Will be called when screen first loads.
> 2) reinit() - Will be called when screen is reloaded.
> Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1019) JSF initial state

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1019?page=comments#action_12362462 ] 

Martin Marinschek commented on MYFACES-1019:
--------------------------------------------

Indeed, this should be discussed on the user-list, and if you are looking for a solution - it is implemented in Shale.

> JSF initial state
> -----------------
>
>          Key: MYFACES-1019
>          URL: http://issues.apache.org/jira/browse/MYFACES-1019
>      Project: MyFaces
>         Type: Improvement
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Linux, WindowXP, JDeveloper
>     Reporter: Guy Bashan

>
> I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> It seems like JSF does not give any solution to initial state problem.
> A simple example:
> I want to show a simple table that is being updated according to several filters.
> The table should be shown with initial data according to filters selections.
> The actions that I am doing are:
> 1) To show initially the table, on the backing bean constructor I am loading the table data.
> 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> For example, I would expect that in addition to the constructor there will be 2 additional methods:
> 1) init() - Will be called when screen first loads.
> 2) reinit() - Will be called when screen is reloaded.
> Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1019) JSF initial state

Posted by "Guy Bashan (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1019?page=comments#action_12362461 ] 

Guy Bashan commented on MYFACES-1019:
-------------------------------------

This issue is not a bug, it is Improvement. I hope you read it ... The first part deals with the problem, the second part deals with suggested improvement.

> JSF initial state
> -----------------
>
>          Key: MYFACES-1019
>          URL: http://issues.apache.org/jira/browse/MYFACES-1019
>      Project: MyFaces
>         Type: Improvement
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Linux, WindowXP, JDeveloper
>     Reporter: Guy Bashan

>
> I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> It seems like JSF does not give any solution to initial state problem.
> A simple example:
> I want to show a simple table that is being updated according to several filters.
> The table should be shown with initial data according to filters selections.
> The actions that I am doing are:
> 1) To show initially the table, on the backing bean constructor I am loading the table data.
> 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> For example, I would expect that in addition to the constructor there will be 2 additional methods:
> 1) init() - Will be called when screen first loads.
> 2) reinit() - Will be called when screen is reloaded.
> Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1019) JSF initial state

Posted by "Guy Bashan (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1019?page=comments#action_12362519 ] 

Guy Bashan commented on MYFACES-1019:
-------------------------------------

Thanks a lot for your answers.

> JSF initial state
> -----------------
>
>          Key: MYFACES-1019
>          URL: http://issues.apache.org/jira/browse/MYFACES-1019
>      Project: MyFaces
>         Type: Improvement
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Linux, WindowXP, JDeveloper
>     Reporter: Guy Bashan

>
> I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> It seems like JSF does not give any solution to initial state problem.
> A simple example:
> I want to show a simple table that is being updated according to several filters.
> The table should be shown with initial data according to filters selections.
> The actions that I am doing are:
> 1) To show initially the table, on the backing bean constructor I am loading the table data.
> 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> For example, I would expect that in addition to the constructor there will be 2 additional methods:
> 1) init() - Will be called when screen first loads.
> 2) reinit() - Will be called when screen is reloaded.
> Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1019) JSF initial state

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1019?page=comments#action_12362478 ] 

Werner Punz commented on MYFACES-1019:
--------------------------------------

As Martin has pointed out, this is more of a usage problem, and definitely not scope of a myfaces bug.
The solution is the shale view controller, if you are not familiar with that one, also servlet filters work, or phase listeners.
(although phase listeners can only trigger an initial state securely not an ending one, due to the possibiltiy of skipping additional phases programmatically)

Not having such things in normal backing beans is probably a design decision, as it seems the JSF specificators kept the syntax of the backing beans as POJO as possible, having such callback would break the POJO paradigm.

(Shale for instance uses to my knowledge a special View Controller interface which introduces the callbacks into the backing bean)


> JSF initial state
> -----------------
>
>          Key: MYFACES-1019
>          URL: http://issues.apache.org/jira/browse/MYFACES-1019
>      Project: MyFaces
>         Type: Improvement
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Linux, WindowXP, JDeveloper
>     Reporter: Guy Bashan

>
> I am having this problem for a long time and lost any hope of getting a decent answer in any forum:
> It seems like JSF does not give any solution to initial state problem.
> A simple example:
> I want to show a simple table that is being updated according to several filters.
> The table should be shown with initial data according to filters selections.
> The actions that I am doing are:
> 1) To show initially the table, on the backing bean constructor I am loading the table data.
> 2) On any "valueChange" of every filter I want to load the new data of the table also, so I load the data again.
> This causes the data of the table to be loaded twice: once in the constructor and second in the value change listener method.
> This problem happens in many variations many times in JSF. Is there a way of initializing data properly ?
> For example, I would expect that in addition to the constructor there will be 2 additional methods:
> 1) init() - Will be called when screen first loads.
> 2) reinit() - Will be called when screen is reloaded.
> Am I missing here something ?  Or there is a solid agreed way of solving the initial state term in JSF.
> By the way, I have to initialize data dynamically and not using managed properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira