[jboss-cvs] jboss-seam/src/ui/org/jboss/seam/ui ...
Gavin King
gavin.king at jboss.com
Sun Oct 1 21:16:38 EDT 2006
User: gavin
Date: 06/10/01 21:16:38
Modified: src/ui/org/jboss/seam/ui UIDecorate.java
Log:
more robust search for the input
Revision Changes Path
1.3 +25 -12 jboss-seam/src/ui/org/jboss/seam/ui/UIDecorate.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIDecorate.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/UIDecorate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- UIDecorate.java 2 Oct 2006 01:10:57 -0000 1.2
+++ UIDecorate.java 2 Oct 2006 01:16:38 -0000 1.3
@@ -42,7 +42,20 @@
String id = getFor();
if (id==null)
{
- for (Object child: getChildren())
+ return getInputId(this);
+ }
+ else
+ {
+ return id;
+ }
+ }
+
+ /**
+ * A depth-first search for a UIInput
+ */
+ private String getInputId(UIComponent component)
+ {
+ for (Object child: component.getChildren())
{
if (child instanceof UIInput)
{
@@ -52,13 +65,13 @@
return input.getId();
}
}
- }
- return null;
- }
- else
+ else if (child instanceof UIComponent)
{
- return id;
+ String id = getInputId(component);
+ if (id!=null) return id;
+ }
}
+ return null;
}
@Override
More information about the jboss-cvs-commits
mailing list