1 Reply Latest reply on Nov 27, 2007 9:58 AM by Georg Raffer

    suggestionbox event (component source)

    Georg Raffer Newbie

      Hi guys,

      I'm using multiple rich:suggestionbox and for a generic approach I need the action source (which suggestionbox = component fired the event).
      Attribute suggestionAction accepts a mehtodbinding which passes the value of the suggestion field.

      Any ideas how to get the component that fired the event?

      Thank you!

      bye, Georg

        • 1. Re: suggestionbox event (component source)
          Georg Raffer Newbie

          found one solution; but is there a better way?

           // get event source
           Map<String,String> m = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
           String source = null;
           for(String k : m.keySet()){
           // all sugg. are prefixed with r_sugg_
           if(StringUtils.contains(k, "r_sugg_")){
           source = k;
           break;
           }
           }
           UIComponent suggComp = FacesContext.getCurrentInstance().getViewRoot().findComponent(source);