Examples of AjaxContext


Examples of org.ajax4jsf.context.AjaxContext

        UIParameter p = (UIParameter)child;
        parameters.put(p.getName(), p.getValue());
      }
    }
   
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    Map<String, Object> commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
    if (commonAjaxParameters != null) {
      parameters.putAll(commonAjaxParameters);
    }
   
    return parameters;
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

  }

  public void addPopupToAjaxRendered(FacesContext context,
      UICalendar component) {

    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
    String clientId = component.getClientId(context);

    if (ajaxContext.isAjaxRequest() && ajaxRenderedAreas.contains(clientId)) {
      ajaxRenderedAreas.add(clientId + "Popup");

      ajaxRenderedAreas.add(clientId + "IFrame");

      ajaxRenderedAreas.add(clientId + "Script");
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    if (requestParameterMap.get(clientId + CURRENT_DATE_PRELOAD) != null) {
      // TODO nick - nick - queue this event when ValueChangeEvent is
      // queued?
      new AjaxEvent(component).queue();

      AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
      if (ajaxContext.isAjaxRequest(context)) {
        ajaxContext.addAreasToProcessFromComponent(context, component);
      }
    }
   
    String selectedDateString = (String) requestParameterMap.get(clientId
        + "InputDate");
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

            // complete re-Render fields. AjaxEvent deliver before render
            // response.
            this.setupReRender(context);
            // Put data for send in response
            Object data = this.getData();
            AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
            if (null != data)
            {
                ajaxContext.setResponseData(data);
            }
            String focus = this.getFocus();
            if (null != focus)
            {
                // search for component in tree.
                // XXX - use more pourful search, as in h:outputLabel
                // component.
                UIComponent focusComponent = RendererUtils.getInstance().findComponentFor(this, focus);
                if (null != focusComponent)
                {
                    focus = focusComponent.getClientId(context);
                }
                ajaxContext.getResponseDataMap().put(FOCUS_DATA_ID, focus);
            }
            ajaxContext.setOncomplete(this.getOncomplete());
        }
  }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

  public void broadcast(FacesEvent event) throws AbortProcessingException {
    // TODO Auto-generated method stub
    if (event instanceof AjaxEvent) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      AjaxContext ajaxContext = AjaxContext
          .getCurrentInstance(facesContext);
      ajaxContext.addRegionsFromComponent(this);
      if (getPreload() != null) {
        ajaxContext.setResponseData(getPreload());
      }
    } else {
      if (event instanceof CurrentDateChangeEvent) {
        FacesContext facesContext = getFacesContext();
        CurrentDateChangeEvent dateChangeEvent = (CurrentDateChangeEvent) event;
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

         
        }

      }
     
      AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
      ajaxContext.addRegionsFromComponent(component);
      ajaxContext.addComponentToAjaxRender(component);
      ajaxContext.addRegionsFromComponent(component);
     
      ajaxContext.addRenderedArea(clientId + ":tb");
     
      // FIXME: check for correct client id.
      // Now path & client id mixed here, it is possible that
      // they will be different un case of dataTable in dataTable.
     
      // Due to we are re render whole data table, Ajax runtime didn't add to reRender  
      // ids of those childs that specified in reRender data table attribute
      // so let's add them to ajax render areas here by hand
      Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
      Set<String> areasToRender = ajaxContext.getAjaxAreasToRender();
      for (String area : areasToRender) {
          // process only child components, all other should be added to render
          // automatically by ajax
          if (area.startsWith(NamingContainer.SEPARATOR_CHAR + clientId)) {
        area = area.substring(1); // remove unnecessary start separator symbol
        if (!area.equals(clientId) && !ajaxRenderedAreas.contains(area)) {
            ajaxContext.addRenderedArea(area);
        }
          }
      }
    }
  }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

  @Override
  public void encodeEnd(FacesContext context, UIComponent component)
      throws IOException {
    super.encodeEnd(context, component);
    if (component instanceof UIDataTable) {
      AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
      Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
      String clientId = ((UIDataTable) component).getBaseClientId(context);
      if(ajaxRenderedAreas.contains(clientId+ ":tb")) {
        ajaxRenderedAreas.remove(clientId);
      }
    }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

        super.broadcast(event);
        if (event instanceof AjaxEvent) {
            FacesContext context = getFacesContext();
            setupValue(context);

            AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);

            if (this.isUsingSuggestObjects()) {
                Object modelValues = getModelValuesData();
                Object requestedData = getRequestedValuesData();

                if (null != modelValues || null != requestedData) {
              Map<String,Object> map = new HashMap<String, Object>();
              map.put("suggestionObjects", modelValues);

              if (requestedData != null) {
            map.put("requestedObjects", requestedData);
              }

              ajaxContext.setResponseData(map);
          }
            }
           
            AjaxRendererUtils.addRegionsFromComponent(this, context);
            AjaxRendererUtils.addRegionByName(context, this, this.getId());
//            setSubmitted(true);
            if (isSelfRendered()) {
                ajaxContext.setSelfRender(true);
            }
        } else if (event instanceof SelectSuggestionEvent) {
          setValue(null);
        }
    }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

            // add toggle panel itself to rendered list of components
            AjaxRendererUtils.addRegionByName(context, panel, panel.getId());
            AjaxRendererUtils.addRegionsFromComponent(tab, context);

            AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
            Set<String> toProcess = ajaxContext.getAjaxAreasToProcess();
            if (toProcess == null) {
                toProcess = new HashSet<String>(1);
                ajaxContext.setAjaxAreasToProcess(toProcess);
            }
            toProcess.add(panel.getClientId(context));

            ajaxContext.addAreasToProcessFromComponent(context, tab);
        }
    }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    brige = new AjaxRegionBrige(this);
  }

  @Override
  public void processDecodes(FacesContext context) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
    // Process this component itself
    try {
      decode(context);
    } catch (RuntimeException e) {
      context.renderResponse();
      throw e;
    }
    if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
      invokeOnComponent(context, ajaxSingleClientId, new ContextCallbackWrapper(decodeCallback));
      Set<String> areasToProcess = ajaxContext.getAjaxAreasToProcess();
      if(null != areasToProcess){
        for (String areaId : areasToProcess) {
          invokeOnComponent(context, areaId, new ContextCallbackWrapper(decodeCallback));
        }
      }
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.