Examples of AjaxContext


Examples of org.ajax4jsf.context.AjaxContext

    }
  }

  @Override
  public void processValidators(FacesContext context) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
    if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
      invokeOnComponent(context, ajaxSingleClientId,  new ContextCallbackWrapper(validateCallback));
      Set<String> areasToProcess = ajaxContext.getAjaxAreasToProcess();
      if(null != areasToProcess){
        for (String areaId : areasToProcess) {
          invokeOnComponent(context, areaId, new ContextCallbackWrapper(validateCallback));
        }
      }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    }
  }

  @Override
  public void processUpdates(FacesContext context) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
    if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
      invokeOnComponent(context, ajaxSingleClientId, new ContextCallbackWrapper(updateCallback));
      Set<String> areasToProcess = ajaxContext.getAjaxAreasToProcess();
      if(null != areasToProcess){
        for (String areaId : areasToProcess) {
          invokeOnComponent(context, areaId, new ContextCallbackWrapper(updateCallback));
        }
      }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    // TODO Auto-generated method stub
    return null;
  }

  private ViewIdHolder setupNavigation(FacesContext context) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    ViewIdHolder viewIdHolder = ajaxContext.getViewIdHolder();
    ajaxContext.setViewIdHolder(this);
    return viewIdHolder;
  }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    ajaxContext.setViewIdHolder(this);
    return viewIdHolder;
  }

  private void restoreNavigation(FacesContext context, ViewIdHolder viewIdHolder) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
    ajaxContext.setViewIdHolder(viewIdHolder);
//    if (wasNavigation) {
//      // Clear children to avoid have different components with same id
//      getChildren().clear();
//    }
  }
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

  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

    writer.writeAttribute(HTML.id_ATTRIBUTE, clientId+"_menu_script", null);
    writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
    encodeScript(context, layer);
    writer.endElement(HTML.SCRIPT_ELEM);

    AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
    Set renderedAreas = ajaxContext.getAjaxRenderedAreas();
    renderedAreas.add(clientId + "_menu_script");
  }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

    writer.writeAttribute(HTML.id_ATTRIBUTE, id, null);
    writer.writeAttribute(HTML.NAME_ATTRIBUTE, id, null);
    writer.writeAttribute(HTML.value_ATTRIBUTE, string, null);
    writer.endElement(HTML.INPUT_ELEM);
   
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
   
    if (ajaxContext.isAjaxRequest()) {
      ajaxContext.addRenderedArea(id);
    }
   
  }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

   *            Faces Event instance
   */
  public void broadcast(FacesEvent event) throws AbortProcessingException {

    FacesContext facesContext = FacesContext.getCurrentInstance();
    AjaxContext ajaxContext = AjaxContextImpl
        .getCurrentInstance(facesContext);
    Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
    String clientId = this.getClientId(facesContext);

    if (!params.containsKey(clientId)) {
      return;
    }

    if (event instanceof ActionEvent) {
      ActionListener listeners[] = getActionListeners();
      for (ActionListener l : listeners) {
        l.processAction((ActionEvent) event);
      }
    } else if (event instanceof AjaxEvent) {

      if (!params.containsKey(FORCE_PERCENT_PARAM)
          && params.containsKey(PERCENT_PARAM)) {
        Number value = getNumber(this.getAttributes().get(
            RendererUtils.HTML.value_ATTRIBUTE));
        ajaxContext.removeRenderedArea(clientId);
        ajaxContext
            .setResponseData(getResponseData(value, facesContext));

        AjaxRendererUtils.addRegionsFromComponent(this, facesContext);
      } else if (params.containsKey(FORCE_PERCENT_PARAM)) {
        if (logger.isDebugEnabled()) {
          logger.debug("Force state: "
              + this.getClientId(facesContext));
        }
        ajaxContext.addComponentToAjaxRender(this);
        String forcedState = params.get(FORCE_PERCENT_PARAM);
        if ("complete".equals(forcedState)) {
          Object reRender = this.getAttributes().get("reRenderAfterComplete");
          Set<String> ajaxRegions = AjaxRendererUtils.asSet(reRender);

          if (ajaxRegions != null) {
            for (Iterator<String> iter = ajaxRegions.iterator(); iter
                .hasNext();) {
              String id = iter.next();
              ajaxContext.addComponentToAjaxRender(this, id);
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.ajax4jsf.context.AjaxContext

     
      return returnScript;
    }

    public String renderSliderJs1(FacesContext context, UIDataFltrSlider slider) throws IOException {
  AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
      StringBuffer script = new StringBuffer();
      String clientId = slider.getClientId(context);
      script.append("var dataFilterSlider = ");
        script.append("new ");
     
         StringBuffer options = new StringBuffer();
      options.append("{");
      options.append("range: $R(" + slider.getStartRange() + "," + slider.getEndRange() + ")");
      options.append(",values: [" + slider.getSliderRange() + "]");
      options.append(",startSpan: '"+ clientId +"slider-trailer'");
      options.append(",sliderInputId: '" + clientId + "slider_val'");
      options.append(",isAjax: " + ajaxContext.isAjaxRequest());
      options.append(",sliderValue:$('"+ clientId +"slider_val').value");
     
      String onslide = getEventHandlerFunction(slider, "onslide");
      if(onslide != null){
          options.append(", onslide: " + onslide);
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.