myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Büttner ...@buett.at>
Subject Re: Problem with Ajax and ViewScope
Date Tue, 29 Jun 2010 10:56:14 GMT
Thx for your response. I created an issue.

https://issues.apache.org/jira/browse/MYFACES-2776

Marcus

Werner Punz schrieb:
> Hi there is some optimization work going on currently on the 
> viewstate, you might have triggered a bug in the trunk, can you file a 
> jira issue on this one?
>
>
> Werner
>
>
> Am 29.06.10 11:05, schrieb Marcus Büttner:
>> Hi,
>>
>> a small example with two input fields, both with valueChangeListener and
>> a f:ajax for rerendering the output field:
>>
>> <h:form id="myForm">
>> <h:outputLabel for="val1" value="Value1"/>
>> <h:inputText id="val1"
>> value="#{myBean.val1}"
>> valueChangeListener="#{myBean.val1ChangedListener}">
>> <f:ajax render="myText" event="change" />
>> </h:inputText>
>>
>> <h:outputLabel for="val2" value="Value2"/>
>> <h:inputText id="val2"
>> value="#{myBean.val2}"
>> valueChangeListener="#{myBean.val2ChangedListener}">
>> <f:ajax render="myText" event="change" />
>> </h:inputText>
>>
>> <h:outputText id="myText" value="#{myBean.val1} #{myBean.val2}"/>
>> </h:form>
>>
>> Everything works fine, until my Bean is ViewScoped. Every time I change
>> a value in the input fields, this value is rendered in my output. But
>> all changes before are lost.
>> E.g.
>> change value1 to "value1" causes output = "value1"
>> change value2 to "value2" causes output = "value2" (but it should be:
>> "value1 value2")
>>
>> I've debugged and found, that in restoreView always the first ViewState
>> (which was active after entering the page) is restored. It looks like,
>> the javax.faces.ViewState component in html DOM tree is not updated by
>> an ajax request and so always the first ViewState is restored instead of
>> the last.
>>
>> I'm using the last MyFaces Snapshot (2.0.1-SNAPSHOT).
>>
>> Does anyone has an idea? Or is something wrong in my code?
>>
>> Thx for help.
>>
>> Regards Marcus
>>
>>
>>
>>
>
>


Mime
View raw message