Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[ ADF, JDev12.1.3 ] Use of "findComponent" (in managed beans) fails when trying to find af:table in

FlattitNov 20 2017 — edited Nov 21 2017

Hallo,

to find UICs from managed bean I use this simple function that till now had always worked well...

public static UIComponent findComponent(final String id) {

FacesContext context = FacesContext.getCurrentInstance();

UIViewRoot root = context.getViewRoot();

final UIComponent\[\] found = new UIComponent\[1\];

root.visitTree(new FullVisitContext(context), new VisitCallback() {

  @Override

  public VisitResult visit(VisitContext context, UIComponent component) {

    if (component.getId().equals(id)) {

      found\[0\] = component;

      return VisitResult.COMPLETE;

    }

    return VisitResult.ACCEPT;

  }

});

return found\[0\];

}

Now I have a situation in which it doesn't work.

In my view scoped managed bean I need to find the af:table "TT" in the jspx page associated with the bean. The af:table is inside a popup as you can see here...

Immagine.png

The function works well with every UIC of the page, including popups, but returns null when called to find "TT"...

RichTable table = (RichTable) FacesUtils.findComponent("TT");

Do you have any idea of this strange phenomenon?

Thanks,

Federico

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2017
Added on Nov 20 2017
4 comments
564 views