Package org.primefaces.util

Examples of org.primefaces.util.WidgetBuilder


        writer.endElement("table");
    }

    protected void encodeScript(FacesContext context, SelectManyCheckbox checkbox) throws IOException {
        String clientId = checkbox.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("SelectManyCheckbox", checkbox.resolveWidgetVar(), clientId).finish();
    }
View Full Code Here


        return request;
    }
 
  protected void encodeScript(FacesContext context, CommandButton button) throws IOException {
    String clientId = button.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("CommandButton", button.resolveWidgetVar(), clientId);
       
    encodeClientBehaviors(context, button);
       
        wb.finish();
  }
View Full Code Here

    ResponseWriter writer = context.getResponseWriter();
    String clientId = slider.getClientId(context);
        boolean range = slider.isRange();
        UIComponent output = getTarget(context, slider, slider.getDisplay());
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Slider", slider.resolveWidgetVar(), clientId);
                   
        if(range) {
            String[] inputIds = slider.getFor().split(",");
            UIComponent inputMin = getTarget(context, slider, inputIds[0].trim());
            UIComponent inputMax = getTarget(context, slider, inputIds[1].trim());
            String inputMinValue = ComponentUtils.getValueToRender(context, inputMin);
            String inputMaxValue = ComponentUtils.getValueToRender(context, inputMax);
           
            wb.attr("input", inputMin.getClientId(context) + "," + inputMax.getClientId(context))
                .append(",values:[").append(inputMinValue).append(",").append(inputMaxValue).append("]");
        }
        else {
            UIComponent input = getTarget(context, slider, slider.getFor());
           
            wb.attr("value", ComponentUtils.getValueToRender(context, input))
               .attr("input", input.getClientId(context));
        }
       
        wb.attr("min", slider.getMinValue())
            .attr("max", slider.getMaxValue())
            .attr("animate", slider.isAnimate())
            .attr("step", slider.getStep())
            .attr("orientation", slider.getType())
            .attr("disabled", slider.isDisabled(), false)
            .attr("range", range)
            .attr("displayTemplate", slider.getDisplayTemplate(), null)
            .callback("onSlideStart", "function(event,ui)", slider.getOnSlideStart())
            .callback("onSlide", "function(event,ui)", slider.getOnSlide())
            .callback("onSlideEnd", "function(event,ui)", slider.getOnSlideEnd());
       
        if(output != null) {
            wb.attr("display", output.getClientId(context));
        }
    
        encodeClientBehaviors(context, slider);

        wb.finish();
  }
View Full Code Here

    writer.endElement("button");
    }
 
  protected void encodeScript(FacesContext context, SplitButton button) throws IOException {
    String clientId = button.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("SplitButton", button.resolveWidgetVar(), clientId);
        wb.attr("appendTo", SearchExpressionFacade.resolveComponentForClient(context, button, button.getAppendTo()), null);
        wb.finish();
    }
View Full Code Here

   
    protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException{
        MegaMenu menu = (MegaMenu) abstractMenu;
    String clientId = menu.getClientId(context);
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("MegaMenu", menu.resolveWidgetVar(), clientId)
            .attr("autoDisplay", menu.isAutoDisplay())
            .attr("activeIndex", menu.getActiveIndex(), Integer.MIN_VALUE);
   
        wb.finish();
  }
View Full Code Here

    protected void encodeScript(FacesContext context, ProgressBar progressBar) throws IOException {
        String clientId = progressBar.getClientId(context);
        boolean isAjax = progressBar.isAjax();
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("ProgressBar", progressBar.resolveWidgetVar(), clientId)
            .attr("initialValue", progressBar.getValue())
            .attr("ajax", isAjax)
            .attr("labelTemplate", progressBar.getLabelTemplate(), null)
            .attr("global", progressBar.isGlobal(), true);
       
        if(isAjax) {
            wb.attr("interval", progressBar.getInterval());
           
            encodeClientBehaviors(context, progressBar);
        }

        wb.finish();
    }
View Full Code Here

    @Override
  protected void encodeScript(FacesContext context, SelectOneMenu menu) throws IOException {
        ThemeSwitcher ts = (ThemeSwitcher) menu;
        String clientId = ts.getClientId(context);
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("ThemeSwitcher", ts.resolveWidgetVar(), clientId)
                .attr("effect", ts.getEffect(), null)
                .attr("effectSpeed", ts.getEffectSpeed(), null);

        wb.finish();
  }
View Full Code Here

    }
        else {
      throw new FacesException("\"For\" option must be used to define a watermark.");
    }
   
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.initWithDomReady("Watermark", watermark.resolveWidgetVar(), watermark.getClientId(context), "watermark")
            .attr("value", escapeText(watermark.getValue()))
            .attr("target", target);

    wb.finish();
  }
View Full Code Here

   
    protected void encodeScript(FacesContext context, DataScroller ds, int chunkSize) throws IOException {
        String clientId = ds.getClientId(context);
        String loadEvent = ds.getFacet("loader") == null ? "scroll" : "manual";
       
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("DataScroller", ds.resolveWidgetVar(), clientId)
            .attr("chunkSize", chunkSize)
            .attr("totalSize", ds.getRowCount())
            .attr("loadEvent", loadEvent)
            .attr("mode", ds.getMode(), "document")
            .attr("buffer", ds.getBuffer())
View Full Code Here

        }
    }
   
    protected void encodeScript(FacesContext context, DataGrid grid) throws IOException {
        String clientId = grid.getClientId();
        WidgetBuilder wb = getWidgetBuilder(context);
        wb.init("DataGrid", grid.resolveWidgetVar(), clientId);
       
        if(grid.isPaginator()) {
            encodePaginatorConfig(context, grid, wb);
        }
       
        encodeClientBehaviors(context, grid);

        wb.finish();
    }
View Full Code Here

TOP

Related Classes of org.primefaces.util.WidgetBuilder

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.