@@ -43,34 +43,37 @@ public static void invokeOnDeepestEditableValueHolder(FacesContext context, UICo
4343 List <AttachedObjectTarget > targets = (List <AttachedObjectTarget >) info .getBeanDescriptor ()
4444 .getValue (AttachedObjectTarget .ATTACHED_OBJECT_TARGETS_KEY );
4545
46- for (AttachedObjectTarget target : targets ) {
47- if (target instanceof EditableValueHolderAttachedObjectTarget ) {
46+ if (targets != null ) {
47+ for (int i = 0 ; i < targets .size (); i ++) {
48+ AttachedObjectTarget target = targets .get (i );
49+ if (target instanceof EditableValueHolderAttachedObjectTarget ) {
4850
49- List <UIComponent > childs = target .getTargets (composite );
50- if (childs == null || childs .isEmpty ()) {
51- throw new FacesException (
52- "Cannot not resolve editableValueHolder target in composite component with id: \" "
53- + composite .getClientId () + "\" " );
54- }
51+ List <UIComponent > childs = target .getTargets (composite );
52+ if (childs == null || childs .isEmpty ()) {
53+ throw new FacesException (
54+ "Cannot not resolve editableValueHolder target in composite component with id: \" "
55+ + composite .getClientId () + "\" " );
56+ }
5557
56- if (childs .size () > 1 ) {
57- throw new FacesException (
58- "Only a single editableValueHolder target is supported in composite component with id: \" "
59- + composite .getClientId () + "\" " );
60- }
58+ if (childs .size () > 1 ) {
59+ throw new FacesException (
60+ "Only a single editableValueHolder target is supported in composite component with id: \" "
61+ + composite .getClientId () + "\" " );
62+ }
6163
62- final UIComponent child = childs .get (0 );
64+ final UIComponent child = childs .get (0 );
6365
64- composite .invokeOnComponent (context , composite .getClientId (context ), new ContextCallback () {
65- public void invokeContextCallback (FacesContext context , UIComponent target ) {
66- if (isComposite (child )) {
67- invokeOnDeepestEditableValueHolder (context , child , callback );
66+ composite .invokeOnComponent (context , composite .getClientId (context ), new ContextCallback () {
67+ public void invokeContextCallback (FacesContext context , UIComponent target ) {
68+ if (isComposite (child )) {
69+ invokeOnDeepestEditableValueHolder (context , child , callback );
70+ }
71+ else {
72+ callback .invokeContextCallback (context , child );
73+ }
6874 }
69- else {
70- callback .invokeContextCallback (context , child );
71- }
72- }
73- });
75+ });
76+ }
7477 }
7578 }
7679 }
0 commit comments