code: @Override
      public void decode(FacesContext context, UIComponent component) {
          Tree tree = (Tree) component;
          super.decode(context, tree);
  
          final TreeNodeEventListener nodeSelectionListener = tree.getNodeSelectionListener();
          String params = context.getExternalContext().getRequestParameterMap().get("params");
  
          if (params != null) {
              params = params.replace("BsFEvent=", "");
              String[] pair = params.split(":", 2);
              String key = pair[0];
              Integer value = null;
              if (pair.length == 2)
                  value = Integer.valueOf(pair[1]);
              
              if (value != null) {
                  Node n = TreeModelUtils.searchNodeById(tree.getValue(), value);
  
                  if (nodeSelectionListener != null && n != null) {
                      // execute listener only for listened events
                      if ("nodeSelected".equals(key)) {
                          n.setSelected(true);
                          nodeSelectionListener.processValueSelected(new TreeNodeSelectionEvent(n, true));
                      } else if ("nodeUnselected".equals(key)) {
                          n.setSelected(false);
                          nodeSelectionListener.processValueSelected(new TreeNodeSelectionEvent(n, false));
                      } else if ("nodeChecked".equals(key)) {
                          n.setChecked(true);
                          nodeSelectionListener.processValueChecked(new TreeNodeCheckedEvent(n, true));
                      } else if ("nodeUnchecked".equals(key)) {
                          n.setChecked(false);
                          nodeSelectionListener.processValueChecked(new TreeNodeCheckedEvent(n, false));
                      } else if ("nodeExpanded".equals(key)) {
                          n.setExpanded(true);
                          nodeSelectionListener.processValueExpanded(new TreeNodeExpandedEvent(n, true));
                      } else if ("nodeCollapsed".equals(key)) {
                          n.setExpanded(false);
                          nodeSelectionListener.processValueExpanded(new TreeNodeExpandedEvent(n, false));
                      }
                  }
              }
          }
      }
docs: Decode ajax behaviours specific to the components
  
  @param context
  @param component