[ 
http://issues.apache.org/jira/browse/MYFACES-320?page=comments#action_12359235 
] 

Volker Weber commented on MYFACES-320:
--------------------------------------

This is still a problem, and its easy to reproduce, but not with the above 
example.

If layout="spread" is given the submitted value is never rerendered, but always 
the result of component.getValue().

To reproduce add a immediate=true to the first selectOneListbox  on 
selectbox.jsp in simple example.
Change the selection of favourite Band radio buttons but don't select a value 
in first listbox and submit via 'calculate price' button.

You will recieve a validation error on the listbox and the radio is reseted to 
initial value.

This issue should repopend and patched.

Patch follows  

Regards,
    Volker

svn diff 
tomahawk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlRadioRenderer.java
Index: 
tomahawk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlRadioRenderer.java
===================================================================
--- 
tomahawk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlRadioRenderer.java  
    (Revision 351993)
+++ 
tomahawk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlRadioRenderer.java  
    (Arbeitskopie)
@@ -117,7 +117,7 @@
             converter = null;
         }

-        Object currentValue = uiSelectOne.getValue();
+        Object currentValue = RendererUtils.getObjectValue(uiSelectOne);
         SelectItem selectItem = (SelectItem)selectItemList.get(index);
         Object itemValue = selectItem.getValue();
         String itemStrValue;


> selectOneRadio does not properly persist its value
> --------------------------------------------------
>
>          Key: MYFACES-320
>          URL: http://issues.apache.org/jira/browse/MYFACES-320
>      Project: MyFaces
>         Type: Bug
>     Reporter: Matt Jarvis
>     Assignee: Martin Marinschek
>     Priority: Minor
>      Fix For: 1.1.2

>
> The selectOneRadio component loses its modified value when the view is 
> re-rendered due to validation errors (or the like).
> For example: 
>       <x:selectOneRadio id="animalTypeGroup" 
> value="#{animalManager.animalType}" layout="spread">
>               <f:selectItem itemValue="dog" itemLabel="Dog"/>
>               <f:selectItem itemValue="cat" itemLabel="Cat"/>
>               <f:selectItem itemValue="fish" itemLabel="Fish"/>
>       </x:selectOneRadio>
>       <x:radio for="animalTypeGroup" index="0" />
>       <x:radio for="animalTypeGroup" index="1" />
>       <x:radio for="animalTypeGroup" index="2" />
>       <x:outputText escape="false" value="<br/>"/>
>       <x:outputText id="animalSpecies" value="Animal Species: "/>
>       <x:inputText value="#{animalManager.animalSpecies}"/>
>       <x:outputText escape="false" value="<br/>"/>
>       <x:outputText id="animalGenus" value="Animal Genus: "/>
>       <x:inputText value="#{animalManager.animalGenus}" 
> validator="#{animalManager.validateGenus}"/>
>       <x:outputText escape="false" value="<br/>"/>
>       <x:outputText escape="false" value="<br/>"/>
>       <x:commandButton value="Validate Species" 
> action="#{animalManager.submitForm}" immediate="true"/>
> If you change the animalTypeGroup selection and then the animalGenus 
> validation fails, the change to animalTypeGroup is lost when the view is 
> re-rendered.

-- 
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

Reply via email to