I tried RI and behavior is the same as with MyFasces.

I have put numberListBean in session scope and example wors fine (with RI, but
I expect same behavior with MyFaces).

I have checked and getNumbers() is not called in the critical scenario.

As I can see, method getNumbers() is called two times per request. Firt time in 
applyRequestValues phase, and seccond time in renderResponse phase. 

MyFaces have to assign the current row variable  (var attribute of dataTable 
tag) before it triger action, but it can't. That's why action is not called.  

Why not call action, just skip setting the current row variable?  
Sometimes action does not depend on the current row, but on parameter, like in 
example.

In any case MyFaces should write some worning in log.

For similar cases I suggest:

- read the parameter in constructor and write it to property. Use the same 
property in a field (hidden or not).
- in getter for dataTable attribute read property and make list, but be 
carefull not to do complex calculation twice if property is not changed.

Nebojsa


----- Original Message ----- 
From: "Mathias Brökelmann" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <[email protected]>
Sent: Monday, September 19, 2005 3:51 PM
Subject: Re: Issue MYFACES-247 not resolved !


Your datamodel *will not* be saved between request. That´s not a bug
in myfaces it is specified in the spec. Try using the RI with your
example and you will see the same problem. You have to restore the
value of limit to recreate the datamodel.

You can not do it through the input field because the value may have
been changed between the requests and will not update your limit value
before the decode phase (you could use immediate for the input field
but if the value changes from 1 to 0 no events will be fired again.)

Please try out my suggested changes like using x:savestate
value="#{numberListBean.limit}" this will restore the value of limit
in the restore phase before the decode phase. You can also put a
breakpoint in your getNumbers() method to see when it will be called
(take a look into the stacktrace of the stopped thread).

2005/9/19, Nebojsa Vasiljevic <[EMAIL PROTECTED]>:
> Your discussion went to wrong direction.
>
> The problem is:
>
> The action is not triggered. View is not constructed properly.
>
> I don't need to save anything. If getNumbers() method returns non-empty list 
> fist time, then
> the example works fine after that. If getNumbers() method returns empty list 
> first time, then action attribute is not set properly in the commandLink 
> component. Broken component tree is saved in client or session. So, the 
> problem is about something that IS saved.
>
> The example is based on standard JSF and should work fine in a proper 
> implementation.
> This is serious MyFaces bug.
>
> Nebojsa
>
> ----- Original Message -----
> From: "Mathias Brökelmann" <[EMAIL PROTECTED]>
> To: "MyFaces Discussion" <[email protected]>
> Sent: Monday, September 19, 2005 1:48 PM
> Subject: Re: Issue MYFACES-247 not resolved !
>
>
> That´s an easy one ;)
>
> Try to put your numberListBean into session scope or put it into a
> x:savestate component or use preserveDataModel="true" of x:datatable
>
> Otherwise the state of your bean will not be saved between the
> requests. Each request creates a new instance with limit=0. The method
> getNumbers() is called in the decode phase to determine the row data.
> If the returned list is empty the table decoder can not iterate
> through the rows and will not fire any events.
>
> Take a look into other threads like "commandLink with action inside
> Table" for some more info.
>
> 2005/9/19, Nebojsa Vasiljevic <[EMAIL PROTECTED]>:
> > Foget to mention, the platform is:
> >
> > MyFaces 1.1.0
> > Sun JDK 1.5 on Windows XP
> > Tomat 5  (also tested on 5.5)
> >
> > Ndebojsa
> >
> > ----- Original Message -----
> > From: "Nebojsa Vasiljevic" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Monday, September 19, 2005 1:11 PM
> > Subject: Issue MYFACES-247 not resolved !
> >
> >
> > This is clarified issue scenario:
> >
> > [...]
> >
>
>
> --
> Mathias
>
>
-- 
Mathias

Reply via email to