2 Replies Latest reply on Jul 9, 2008 1:03 PM by accless

    ShortCut for findComponent

    accless

      Hi folks,


      i know that there is a shortcut for the findComponent(), as I read about it in this forum. Unfortunately I cannot find this post again.
      Could somebody give me a hint? Thx in Advance!


      Greetings


      PS: i post this question in the seam forum, as i am not sure if the shortcut is a seam (via s:XXX or EL) or jsf-Feature...

        • 1. Re: ShortCut for findComponent
          dan.j.allen

          The built-in component named uiComponent provides a magic map of UI components. If you were looking for the component id register:nameField:name, you would use the following EL expression:


          #{uiComponent['register:nameField:name']}
          



          You could also inject this component as a Map


          @In Map<String, UIComponent> uiComponent;
          
          UIComponent c = uiComponent.get("register:nameField:name");
          



          As for a convenience method in Seam, yes, it would be helpful if there were a couple of more utility methods for more sophisticated lookup. Check the RichFaces API for such a helper class.

          • 2. Re: ShortCut for findComponent
            accless

            Thx for your help Dan!


            Greetings