Package org.primefaces.component.api

Examples of org.primefaces.component.api.AjaxSource


    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        RemoteCommand command = (RemoteCommand) component;
        AjaxSource source = (AjaxSource) command;
        String clientId = command.getClientId(context);
        String name = resolveName(command, context);
        UIComponent form = (UIComponent) ComponentUtils.findParentForm(context, command);
        if(form == null) {
            throw new FacesException("RemoteCommand '" + name + "'must be inside a form.");
        }
       
        AjaxRequestBuilder builder = RequestContext.getCurrentInstance().getAjaxRequestBuilder();
       
        String request = builder.init()
                        .source(clientId)
                        .form(form.getClientId(context))
                        .process(component, source.getProcess())
                        .update(component, source.getUpdate())
                        .async(source.isAsync())
                        .global(source.isGlobal())
                        .delay(source.getDelay())
                        .timeout(source.getTimeout())
                        .partialSubmit(source.isPartialSubmit(), command.isPartialSubmitSet(), command.getPartialSubmitFilter())
                        .resetValues(source.isResetValues(), source.isResetValuesSet())
                        .ignoreAutoUpdate(source.isIgnoreAutoUpdate())
                        .onstart(source.getOnstart())
                        .onerror(source.getOnerror())
                        .onsuccess(source.getOnsuccess())
                        .oncomplete(source.getOncomplete())
                        .passParams()
                        .build();

        //script
        writer.startElement("script", command);
View Full Code Here


    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        RemoteCommand command = (RemoteCommand) component;
        AjaxSource source = (AjaxSource) command;
        String clientId = command.getClientId(context);
        String name = resolveName(command, context);
        UIComponent form = (UIComponent) ComponentUtils.findParentForm(context, command);
        if(form == null) {
            throw new FacesException("RemoteCommand '" + name + "'must be inside a form.");
        }
       
        AjaxRequestBuilder builder = RequestContext.getCurrentInstance().getAjaxRequestBuilder();
       
        String request = builder.init()
                .source(clientId)
                        .form(form.getClientId(context))
                        .process(component, source.getProcess())
                        .update(component, source.getUpdate())
                        .async(source.isAsync())
                        .global(source.isGlobal())
                        .delay(source.getDelay())
                        .partialSubmit(source.isPartialSubmit(), command.isPartialSubmitSet())
                        .resetValues(source.isResetValues(), source.isResetValuesSet())
                        .ignoreAutoUpdate(source.isIgnoreAutoUpdate())
                        .onstart(source.getOnstart())
                        .onerror(source.getOnerror())
                        .onsuccess(source.getOnsuccess())
                        .oncomplete(source.getOncomplete())
                        .passParams()
                        .build();

        //script
        writer.startElement("script", command);
View Full Code Here

TOP

Related Classes of org.primefaces.component.api.AjaxSource

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.