Examples of UIScript


Examples of org.apache.myfaces.tobago.component.UIScript

public class ScriptRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    UIScript scriptComponent = (UIScript) component;
    String exit = scriptComponent.getOnexit();
    if (exit != null) {
      FacesContextUtils.addOnexitScript(facesContext, exit);
    }
    String submit = scriptComponent.getOnsubmit();
    if (submit != null) {
      FacesContextUtils.addOnsubmitScript(facesContext, submit);
    }
    String load = scriptComponent.getOnload();
    if (load != null) {
      FacesContextUtils.addOnloadScript(facesContext, load);
    }
    String unload = scriptComponent.getOnunload();
    if (unload != null) {
      FacesContextUtils.addOnunloadScript(facesContext, unload);
    }
    String script = scriptComponent.getScript();
    if (script != null) {
      FacesContextUtils.addScriptBlock(facesContext, script);
    }
    String file = scriptComponent.getFile();
    if (file != null) {
      FacesContextUtils.addScriptFile(facesContext, file);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UIScript component = (UIScript) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (onload != null) {
      component.setValueExpression("onload", onload);
    }

    if (file != null) {
      component.setValueExpression("file", file);
    }

    if (onunload != null) {
      component.setValueExpression("onunload", onunload);
    }

    if (script != null) {
      component.setValueExpression("script", script);
    }

    if (onexit != null) {
      component.setValueExpression("onexit", onexit);
    }

    if (onsubmit != null) {
      component.setValueExpression("onsubmit", onsubmit);
    }

  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

  @Override
  public int doAfterBody() throws javax.servlet.jsp.JspException {
    final String content = bodyContent.getString();
    bodyContent.clearBody();
    if (StringUtils.isNotBlank(content)) {
      final UIScript component = (UIScript) getComponentInstance();
      component.setScript(content.trim());
    }
    return super.doAfterBody();
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

public class ScriptRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    UIScript scriptComponent = (UIScript) component;
    String exit = scriptComponent.getOnexit();
    if (exit != null) {
      FacesContextUtils.addOnexitScript(facesContext, exit);
    }
    String submit = scriptComponent.getOnsubmit();
    if (submit != null) {
      FacesContextUtils.addOnsubmitScript(facesContext, submit);
    }
    String load = scriptComponent.getOnload();
    if (load != null) {
      FacesContextUtils.addOnloadScript(facesContext, load);
    }
    String unload = scriptComponent.getOnunload();
    if (unload != null) {
      FacesContextUtils.addOnunloadScript(facesContext, unload);
    }
    String script = scriptComponent.getScript();
    if (script != null) {
      FacesContextUtils.addScriptBlock(facesContext, script);
    }
    String file = scriptComponent.getFile();
    if (file != null) {
      FacesContextUtils.addScriptFile(facesContext, file);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

public class ScriptRenderer extends RendererBase {

  public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    final UIScript scriptComponent = (UIScript) component;
    final String exit = scriptComponent.getOnexit();
    if (exit != null) {
      FacesContextUtils.addOnexitScript(facesContext, exit);
    }
    final String submit = scriptComponent.getOnsubmit();
    if (submit != null) {
      FacesContextUtils.addOnsubmitScript(facesContext, submit);
    }
    final String load = scriptComponent.getOnload();
    if (load != null) {
      FacesContextUtils.addOnloadScript(facesContext, load);
    }
    final String unload = scriptComponent.getOnunload();
    if (unload != null) {
      FacesContextUtils.addOnunloadScript(facesContext, unload);
    }
    final String script = scriptComponent.getScript();
    if (script != null) {
      FacesContextUtils.addScriptBlock(facesContext, script);
    }
    final String file = scriptComponent.getFile();
    if (file != null) {
      FacesContextUtils.addScriptFile(facesContext, file);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UIScript component = (UIScript) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (onload != null) {
      component.setValueExpression("onload", onload);
    }

    if (file != null) {
      component.setValueExpression("file", file);
    }

    if (onunload != null) {
      component.setValueExpression("onunload", onunload);
    }

    if (script != null) {
      component.setValueExpression("script", script);
    }

    if (onexit != null) {
      component.setValueExpression("onexit", onexit);
    }

    if (onsubmit != null) {
      component.setValueExpression("onsubmit", onsubmit);
    }

  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

  @Override
  public int doAfterBody() throws javax.servlet.jsp.JspException {
    final String content = bodyContent.getString();
    bodyContent.clearBody();
    if (StringUtils.isNotBlank(content)) {
      final UIScript component = (UIScript) getComponentInstance();
      component.setScript(content.trim());
    }
    return super.doAfterBody();
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

public class ScriptRenderer extends RendererBase {

  public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    final UIScript scriptComponent = (UIScript) component;
    final String exit = scriptComponent.getOnexit();
    if (exit != null) {
      FacesContextUtils.addOnexitScript(facesContext, exit);
    }
    final String submit = scriptComponent.getOnsubmit();
    if (submit != null) {
      FacesContextUtils.addOnsubmitScript(facesContext, submit);
    }
    final String load = scriptComponent.getOnload();
    if (load != null) {
      FacesContextUtils.addOnloadScript(facesContext, load);
    }
    final String unload = scriptComponent.getOnunload();
    if (unload != null) {
      FacesContextUtils.addOnunloadScript(facesContext, unload);
    }
    final String script = scriptComponent.getScript();
    if (script != null) {
      FacesContextUtils.addScriptBlock(facesContext, script);
    }
    final String file = scriptComponent.getFile();
    if (file != null) {
      FacesContextUtils.addScriptFile(facesContext, file);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIScript

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    if (facesContext instanceof TobagoFacesContext) {
      TobagoFacesContext pageFacesContext = (TobagoFacesContext) facesContext;
      UIScript scriptComponent = (UIScript) component;
      String exit = scriptComponent.getOnexit();
      if (exit != null) {
        pageFacesContext.getOnexitScripts().add(exit);
      }
      String submit = scriptComponent.getOnsubmit();
      if (submit != null) {
        pageFacesContext.getOnsubmitScripts().add(submit);
      }
      String load = scriptComponent.getOnload();
      if (load != null) {
        pageFacesContext.getOnloadScripts().add(load);
      }
      String unload = scriptComponent.getOnunload();
      if (unload != null) {
        pageFacesContext.getOnunloadScripts().add(unload);
      }
      String script = scriptComponent.getScript();
      if (script != null) {
        pageFacesContext.getScriptBlocks().add(script);
      }
      String file = scriptComponent.getFile();
      if (file != null) {
        pageFacesContext.getScriptFiles().add(file);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.