Package org.ajax4jsf.renderkit

Examples of org.ajax4jsf.renderkit.RendererUtils


        if (event instanceof DataFilterSliderEvent){
         
          FacesContext context = FacesContext.getCurrentInstance();
            AjaxRendererUtils.addRegionByName(context, this, this.getId());
            String forAttr = this.getFor();
            RendererUtils rendUtil = RendererUtils.getInstance();
            AjaxRendererUtils.addRegionByName(context, this, rendUtil.correctForIdReference(forAttr, this));
           
           if(getSliderListeners().length < 1){
               addSliderListener(new DataFilterSliderAdapter(getSliderListener()));
           }
       }
View Full Code Here


   *
   * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.component.UIComponent)
   */
  @Override
  public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
    RendererUtils rendererUtils = RendererUtils.getInstance();
   
    Set<String> areasToProcess = AjaxRendererUtils.getAjaxAreasToProcess(component);
    if (areasToProcess != null) {
      Set<String> convertedAreaIds = new HashSet<String>();

      for (String areaId : areasToProcess) {
        UIComponent areaComponent = rendererUtils.findComponentFor(component, areaId);
        if (areaComponent != null) {
          convertedAreaIds.add(areaComponent.getClientId(context));
        } else {
          convertedAreaIds.add(areaId);
        }
View Full Code Here

 
  @Override
  protected void encodeRowEvents(FacesContext context, UIDataAdaptor table)
      throws IOException {
    super.encodeRowEvents(context, table);
    RendererUtils utils2 = getUtils();
    utils2.encodeAttribute(context, table, "onRowContextMenu", "oncontextmenu" );
   
  }
View Full Code Here

        return "return false;";
      }
    } else {
      // Server
      //xxx by nick - denis - use org.ajax4jsf.renderkit.RendererUtils#getNestingForm(FacesContext, UIComponent)
      RendererUtils rendererUtils = new RendererUtils();
      UIForm Form= rendererUtils.getNestingForm(context, component);
      String formId=null;     
      if (Form!=null){
         formId = Form.getClientId(context);
      }           
      if(formId==null) {
View Full Code Here

       
        String eventShow = (toolTip.isAttached()) ? toolTip.getShowEvent() : "";
        if (eventShow.startsWith("on")) {
            eventShow = eventShow.substring(2);
        }
        RendererUtils utils = getUtils();
    utils.addToScriptHash(options, "showEvent", eventShow);
        String eventHide = (toolTip.isAttached()) ? toolTip.getHideEvent() : "";
        if (eventHide.startsWith("on")) {
            eventHide = eventHide.substring(2);
        }
        utils.addToScriptHash(options, "hideEvent", eventHide);

        utils.addToScriptHash(options, "delay", toolTip.getShowDelay(), "0");
        utils.addToScriptHash(options, "hideDelay", toolTip.getHideDelay(), "0");
       
        if (AJAX_MODE.equalsIgnoreCase(toolTip.getMode())) {
          JSFunctionDefinition ajaxFunc = new JSFunctionDefinition("event");
            JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
            Map<String, Object> ajaxOptions = buildEventOptions(context, toolTip);
            ajaxOptions.putAll(getParamsMap(context, toolTip));
            function.addParameter(ajaxOptions);
            ajaxFunc.addToBody(function);
            utils.addToScriptHash(options, "ajaxFunction", ajaxFunc);
       }
       
        JSFunctionDefinition hideFunc = utils.getAsEventHandler(
                context, component, "onhide", "; return true;");
        utils.addToScriptHash(options, "onhide", hideFunc);

        JSFunctionDefinition showFunc = utils.getAsEventHandler(
                context, component, "onshow", "; return true;");
        utils.addToScriptHash(options, "onshow", showFunc);
       
        utils.addToScriptHash(options, "disabled", toolTip.isDisabled(), "false");
        String direction = toolTip.getDirection();
        if (DIRECTION_AUTO.equalsIgnoreCase(direction)) {
            direction = DIRECTION_BOTTOM_RIGHT;
        }
        utils.addToScriptHash(options, "direction", direction, DIRECTION_BOTTOM_RIGHT);
        utils.addToScriptHash(options, "followMouse", toolTip.isFollowMouse(), "false");
        utils.addToScriptHash(options, "horizontalOffset", toolTip.getHorizontalOffset(), "10");
        utils.addToScriptHash(options, "verticalOffset", toolTip.getVerticalOffset(), "10");

        StringBuffer ret = new StringBuffer();
        ret.append("new ToolTip(").append(QUOT).append(toolTip.getClientId(context)).append(QUOT_COMMA)
           .append(QUOT).append(targetClientId).append(QUOT);
        if (!options.isEmpty()) {
View Full Code Here

   *
   * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.component.UIComponent)
   */
  @Override
  public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
    RendererUtils rendererUtils = RendererUtils.getInstance();
   
    Set<String> areasToProcess = AjaxRendererUtils.getAjaxAreasToProcess(component);
    if (areasToProcess != null) {
      Set<String> convertedAreaIds = new HashSet<String>();

      for (String areaId : areasToProcess) {
        UIComponent areaComponent = rendererUtils.findComponentFor(component, areaId);
        if (areaComponent != null) {
          convertedAreaIds.add(areaComponent.getClientId(context));
        } else {
          convertedAreaIds.add(areaId);
        }
View Full Code Here

       
        String eventShow = (toolTip.isAttached()) ? toolTip.getShowEvent() : "";
        if (eventShow.startsWith("on")) {
            eventShow = eventShow.substring(2);
        }
        RendererUtils utils = getUtils();
    utils.addToScriptHash(options, "showEvent", eventShow);
        String eventHide = (toolTip.isAttached()) ? toolTip.getHideEvent() : "";
        if (eventHide.startsWith("on")) {
            eventHide = eventHide.substring(2);
        }
        utils.addToScriptHash(options, "hideEvent", eventHide);

        utils.addToScriptHash(options, "delay", toolTip.getShowDelay(), "0");
        utils.addToScriptHash(options, "hideDelay", toolTip.getHideDelay(), "0");
       
        if (AJAX_MODE.equalsIgnoreCase(toolTip.getMode())) {
          JSFunctionDefinition ajaxFunc = new JSFunctionDefinition("event");
            JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
            Map<String, Object> ajaxOptions = buildEventOptions(context, toolTip);
            ajaxOptions.putAll(getParamsMap(context, toolTip));
            function.addParameter(ajaxOptions);
            ajaxFunc.addToBody(function);
            utils.addToScriptHash(options, "ajaxFunction", ajaxFunc);
       }
       
        JSFunctionDefinition hideFunc = utils.getAsEventHandler(
                context, component, "onhide", "; return true;");
        utils.addToScriptHash(options, "onhide", hideFunc);

        JSFunctionDefinition showFunc = utils.getAsEventHandler(
                context, component, "onshow", "; return true;");
        utils.addToScriptHash(options, "onshow", showFunc);
       
        utils.addToScriptHash(options, "disabled", toolTip.isDisabled(), "false");
        String direction = toolTip.getDirection();
        if (DIRECTION_AUTO.equalsIgnoreCase(direction)) {
            direction = DIRECTION_BOTTOM_RIGHT;
        }
        utils.addToScriptHash(options, "direction", direction, DIRECTION_BOTTOM_RIGHT);
        utils.addToScriptHash(options, "followMouse", toolTip.isFollowMouse(), "false");
        utils.addToScriptHash(options, "horizontalOffset", toolTip.getHorizontalOffset(), "10");
        utils.addToScriptHash(options, "verticalOffset", toolTip.getVerticalOffset(), "10");

        StringBuffer ret = new StringBuffer();
        ret.append("new ToolTip(").append(QUOT).append(toolTip.getClientId(context)).append(QUOT_COMMA)
           .append(QUOT).append(targetClientId).append(QUOT);
        if (!options.isEmpty()) {
View Full Code Here

  private static final String[] OPTIONS_ATTRIBUTES_LIST = { "showConnectingLines", "toggleOnClick",
    "disableKeyboardNavigation", "rightClickSelection"};
 
  public String getOptions(FacesContext context, UITree tree) {
    Map<String, Object> attributes = tree.getAttributes();
    RendererUtils utils = getUtils();
   
    Map<String, Object> options = new HashMap<String, Object>();
    for (String optionAttributeName : OPTIONS_ATTRIBUTES_LIST) {
      Object value = attributes.get(optionAttributeName);
     
      if (utils.shouldRenderAttribute(value)) {
        options.put(optionAttributeName, value);
      }
    }
   
    return ScriptUtils.toScript(options);
View Full Code Here

        super.setupReRender(context);
        //add data slider itself to rendered list of components
        AjaxRendererUtils.addRegionByName(context, this, this.getId());

        String forAttr = this.getFor();
        RendererUtils rendUtil = RendererUtils.getInstance();

        if (forAttr != null) {
            AjaxRendererUtils.addRegionByName(context, this, rendUtil.correctForIdReference(forAttr, this));
        }
    }
View Full Code Here

     * @param table
     * @throws IOException
     */
    protected void encodeRowEvents(FacesContext context, UIDataAdaptor table)
            throws IOException {
        RendererUtils utils2 = getUtils();
        for (int i = 0; i < TABLE_EVENT_ATTRS.length; i++) {
            String[] attrs = TABLE_EVENT_ATTRS[i];
            utils2.encodeAttribute(context, table, attrs[1], attrs[0]);
        }
    }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.renderkit.RendererUtils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.