volosied commented on code in PR #492:
URL: https://github.com/apache/myfaces/pull/492#discussion_r1085984802


##########
api/src/main/java/jakarta/faces/component/UISelectOne.java:
##########
@@ -90,37 +91,43 @@ public void processValidators(FacesContext context)
                 @Override
                 public VisitResult visit(VisitContext visitContext, 
UIComponent target) 
                 {
+                    // check they they are of the same group
                     if (target instanceof UISelectOne  && ((UISelectOne) 
target).getGroup().equals(group)) 
                     {
-                        UISelectOne radio = (UISelectOne) target;
-
-                        // if target is an instance of UISelectOne then get 
all the UISelectItem children
-                        // and verify if the submitted value exists
-                        for (Iterator<UIComponent> iter = 
radio.getChildren().iterator(); iter.hasNext(); ) 
-                        {
-                            UIComponent component = iter.next();
-                            if (component instanceof UISelectItem) 
-                            {
-                                UISelectItem item = (UISelectItem) component;
-                                if 
(item.getItemValue().equals(submittedValue)) 
-                                {
-                                    selectItemValueFound = true;
-                                    return VisitResult.COMPLETE;
-                                }
-                            }
-
-                        }
-                        return VisitResult.REJECT;

Review Comment:
   My understanding is that submittedValue is checked via 
UISelectOne#validateValue which calls into: 
https://github.com/apache/myfaces/blob/89c747e85615e3f33265e664c8361789f38ea7db/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java#L177
   
   Additionally, the spec does not ask for the 
`item.getItemValue().equals(submittedValue)` / `component instanceof 
UISelectItem` checks here. 
   
https://jakarta.ee/specifications/faces/4.0/apidocs/jakarta/faces/component/uiselectone#processValidators(jakarta.faces.context.FacesContext)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to