Package javax.faces.application

Examples of javax.faces.application.Application.createValueBinding()


  }
  public String launch(){
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext != null) {
      Application application = facesContext.getApplication();
      ExperimentBean bean = ((ExperimentBean) application.createValueBinding("#{experiment}").getValue(facesContext));
    try {
      Experiment bean2 = new Experiment();
      this.setExperimentID(bean.getExpName() + UUID.randomUUID());
      bean2.setId(getExperimentID());
      bean2.setName(bean.getExpName());
View Full Code Here


        .getExternalContext().getResponse();
    HttpServletRequest request = (HttpServletRequest) context
        .getExternalContext().getRequest();
    response.setContentType("image/jpeg");
    Application application = context.getApplication();
    ApplicationGlobalContext appContext = (ApplicationGlobalContext) application
        .createValueBinding("#{applicationGlobalContext}").getValue(
            context);
    if (appContext == null) {
      String message = "<h1>Your tomcat server.xml must have emptySessionPath=\"true\", please set the property at your non-SSL HTTP/1.1 Connector</h1>";
      try {
View Full Code Here

    // String workflowId = request.getParameter(WORKFLOW_ID);
    try {
      WorkflowBean bean = new WorkflowBean();
      this.workflow = appContext.getExpBuilderManager().getWorkflow(workflowID);
      bean.setWorkflow(workflow);
      ValueBinding valueBinding = application.createValueBinding("#{workflow}");
      valueBinding.setValue(context, bean);
       
      BufferedImage buffer = workflow.getWorkflowImage();
      response.setContentType("image/png");
View Full Code Here

   * to save memory without the knowledge of the scope.
   * Also useful to enforce a new creation of a managed-bean.
   */
  public static void clearVariable(FacesContext context, String variable) {
    Application application = context.getApplication();
    ValueBinding valueBinding = application.createValueBinding("#{" + variable + "}");
    valueBinding.setValue(context, null);
  }
}
View Full Code Here

  public static void setConverter(ValueHolder valueHolder, String converterId) {
    if (converterId != null && valueHolder.getConverter() == null) {
      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final Application application = facesContext.getApplication();
      if (UIComponentTag.isValueReference(converterId)) {
        ValueBinding valueBinding = application.createValueBinding(converterId);
        if (valueHolder instanceof UIComponent) {
          ((UIComponent) valueHolder).setValueBinding(Attributes.CONVERTER, valueBinding);
        }
      } else {
        Converter converter = application.createConverter(converterId);
View Full Code Here

//    if (FacesVersion.supports12()) {
//      final ELContext elContext = context.getELContext();
//      elContext.getELResolver().setValue(elContext, null, variable, null);
//    } else {
      final Application application = context.getApplication();
      final ValueBinding valueBinding = application.createValueBinding("#{" + variable + "}");
      valueBinding.setValue(context, null);
//    }
  }
}
View Full Code Here

          if (metaData.getColumnType(i) == Types.INTEGER || metaData.getColumnType(i) == Types.FLOAT) {
            column.setAlign("right");
          }
          column.setLabel(name);
          String ref = "#{" + table.getVar() + "." + name + "}";
          ValueBinding binding = application.createValueBinding(ref);
          if (name.equals("NAME")) {
            UICommand command = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
            command.setRendererType("Link");
            command.setValueBinding("label", binding);
            MethodBinding action = application.createMethodBinding("#{test.select}", new Class[0]);
View Full Code Here

  public static void setConverter(ValueHolder valueHolder, String converterId) {
    if (converterId != null && valueHolder.getConverter() == null) {
      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final Application application = facesContext.getApplication();
      if (UIComponentTag.isValueReference(converterId)) {
        ValueBinding valueBinding = application.createValueBinding(converterId);
        if (valueHolder instanceof UIComponent) {
          ((UIComponent) valueHolder).setValueBinding(ATTR_CONVERTER, valueBinding);
        }
      } else {
        Converter converter = application.createConverter(converterId);
View Full Code Here

  public static void setAction(UICommand component, String type, String action) {
    String commandType;
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final Application application = facesContext.getApplication();
    if (type != null && UIComponentTag.isValueReference(type)) {
      commandType = (String) application.createValueBinding(type).getValue(facesContext);
    } else {
      commandType = type;
    }
    if (commandType != null
        && (commandType.equals(COMMAND_TYPE_NAVIGATE)
View Full Code Here

   * @param context
   * @param variable
   */
  public static void clearVariable(FacesContext context, String variable) {
    Application application = context.getApplication();
    ValueBinding valueBinding = application.createValueBinding("#{" + variable + "}");
    valueBinding.setValue(context, null);
  }
}
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.