Package com.liferay.faces.util.js

Examples of com.liferay.faces.util.js.JavaScriptFragment


      if (clientKey == null) {
        clientKey = clientVarName;
      }

      JavaScriptFragment liferayComponent = new JavaScriptFragment("Liferay.component('" + clientKey + "')");
      String clientId = uiComponent.getClientId(facesContext);
      String inputClientId = clientId.concat(INPUT_SUFFIX);

      Object maxDateObject = inputDate.getMaxDate();
      Object minDateObject = inputDate.getMinDate();
View Full Code Here


      //J-
      // var clientVarName = Liferay.component('clientKey');
      //J+
      encodeLiferayComponentVar(responseWriter, clientVarName, clientKey);

      JavaScriptFragment clientVarNameJSFragment = new JavaScriptFragment(clientVarName);
      String clientId = uiComponent.getClientId(facesContext);
      String hiddenClientId = clientId + HIDDEN_SUFFIX;

      //J-
      // LFAI.setAutoCompleteEventListeners(A, clientVarName, 'escapedHiddenClientId', 'clientId');
View Full Code Here

        }

        //J-
        // Liferay.component('clientKey')
        //J+
        JavaScriptFragment liferayComponentJavaScriptFragment = new JavaScriptFragment("Liferay.component('" +
            clientKey + "')");

        // Build up a fragment of JavaScript that contains an array of the results.

        //J-
View Full Code Here

    InputFile inputFile = (InputFile) uiComponent;
    String clientId = inputFile.getClientId(facesContext);

    // Determine the valid content-types and maximum file size from the validator (if specified).
    JavaScriptArray contentTypes = new JavaScriptArray();
    JavaScriptFragment alloyNamespace = new JavaScriptFragment("A");
    long maxFileSize = Long.MAX_VALUE;
    InputFileValidator inputFileValidator = getInputFileValidator(inputFile);

    if (inputFileValidator != null) {
      String validContentTypes = inputFileValidator.getContentTypes();

      if (validContentTypes != null) {
        contentTypes = new JavaScriptArray(validContentTypes.split(","));
      }

      maxFileSize = inputFileValidator.getMaxFileSize();
    }

    // If the component should render the upload progress table, then initialize the YUI progress uploader widget.
    if (inputFile.isShowProgress()) {

      String clientVarName = ComponentUtil.getClientVarName(facesContext, inputFile);
      String clientKey = inputFile.getClientKey();

      if (clientKey == null) {
        clientKey = clientVarName;
      }

      UIViewRoot viewRoot = facesContext.getViewRoot();
      Locale locale = viewRoot.getLocale();
      String formClientId = getParentFormClientId(inputFile);
      Application application = facesContext.getApplication();
      ViewHandler viewHandler = application.getViewHandler();
      String actionURL = viewHandler.getActionURL(facesContext, viewRoot.getViewId());
      String partialActionURL = facesContext.getExternalContext().encodePartialActionURL(actionURL);
      String namingContainerId = StringPool.BLANK;

      if (viewRoot instanceof NamingContainer) {
        namingContainerId = viewRoot.getContainerClientId(facesContext);
      }

      AjaxParameters ajaxParameters = new AjaxParameters(inputFile, clientId, formClientId);
      String execute = ajaxParameters.getExecute();
      String render = ajaxParameters.getRender();

      String notStartedMessage = getMessageContext().getMessage(locale, "not-started");
      JavaScriptFragment clientComponent = new JavaScriptFragment("Liferay.component('" + clientKey + "')");
      RendererUtil.encodeFunctionCall(responseWriter, "LFAI.initProgressUploader", alloyNamespace,
        clientComponent, contentTypes, clientId, formClientId, namingContainerId, inputFile.isAuto(), execute,
        render, partialActionURL, maxFileSize, notStartedMessage);
    }
View Full Code Here

        BrowserSnifferFactory.class);
    BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext());

    if (browserSniffer.isMobile() && inputTime.isResponsive()) {

      JavaScriptFragment liferayComponent = new JavaScriptFragment("Liferay.component('" + clientKey + "')");
      String clientId = uiComponent.getClientId(facesContext);
      String inputClientId = clientId.concat(INPUT_SUFFIX);

      // Get the max and min times in the HTML5 format which does not include seconds.
      int defaultHTML5PatternLength = InputTime.DEFAULT_HTML5_TIME_PATTERN.length();
View Full Code Here

TOP

Related Classes of com.liferay.faces.util.js.JavaScriptFragment

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.