예제 #1
0
 protected static void addOnCompleteParam(FacesContext context, String itemId) {
   ExtendedPartialViewContext.getInstance(context)
       .appendOncomplete(
           new StringBuilder()
               .append("RichFaces.$('")
               .append(itemId)
               .append("').onCompleteHandler();")
               .toString());
 }
예제 #2
0
  protected static void addOnCompleteParam(FacesContext context, String newValue, String panelId) {
    StringBuilder onComplete = new StringBuilder();
    onComplete
        .append("RichFaces.$('")
        .append(panelId)
        .append("').onCompleteHandler('")
        .append(newValue)
        .append("');");

    ExtendedPartialViewContext.getInstance(context).appendOncomplete(onComplete.toString());
  }
  public void encodeMetaComponent(
      FacesContext context, UIComponent component, String metaComponentId) throws IOException {
    if (AbstractAutocomplete.ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {

      List<Object> fetchValues = new ArrayList<Object>();

      PartialResponseWriter partialWriter =
          context.getPartialViewContext().getPartialResponseWriter();
      partialWriter.startUpdate(getStrategy(component).getContainerElementId(context, component));
      encodeItems(context, component, fetchValues);
      partialWriter.endUpdate();

      if (!fetchValues.isEmpty()) {
        Map<String, Object> dataMap =
            ExtendedPartialViewContext.getInstance(context).getResponseComponentDataMap();
        dataMap.put(component.getClientId(context), fetchValues);
      }
    } else {
      throw new IllegalArgumentException(metaComponentId);
    }
  }