Package com.liferay.faces.util.client

Examples of com.liferay.faces.util.client.ClientScriptFactory


  public static void renderScript(FacesContext facesContext, UIComponent uiComponent, String script, String use) {

    // Render the script at the bottom of the page by setting the WebKeys.AUI_SCRIPT_DATA request attribute.
    ExternalContext externalContext = facesContext.getExternalContext();
    ClientScriptFactory clientScriptFactory = (ClientScriptFactory) FactoryExtensionFinder.getFactory(
        ClientScriptFactory.class);
    ClientScript clientScript = clientScriptFactory.getClientScript(externalContext);

    String portletId = StringPool.BLANK;
    Object portlet = externalContext.getRequestMap().get(WebKeys.RENDER_PORTLET);

    if (portlet != null) {
View Full Code Here


      super.startElement(StringPool.SCRIPT, uiComponent);
      super.writeAttribute(StringPool.TYPE, ContentTypes.TEXT_JAVASCRIPT, null);

      FacesContext facesContext = FacesContext.getCurrentInstance();
      ExternalContext externalContext = facesContext.getExternalContext();
      ClientScriptFactory clientScriptFactory = (ClientScriptFactory) FactoryExtensionFinder.getFactory(
          ClientScriptFactory.class);
      ClientScript clientScript = clientScriptFactory.getClientScript(externalContext);
      super.write(clientScript.toString());
      super.endElement(StringPool.SCRIPT);
    }

    super.endElement(name);
View Full Code Here

TOP

Related Classes of com.liferay.faces.util.client.ClientScriptFactory

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.