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

    suggestionbox event (component source)

    graffer3

      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)
          graffer3

          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);