public void resetForm() { RequestContext context = RequestContext.getCurrentInstance(); context.reset(":dataverseForm:themeWidgetsTabView"); }
public AjaxRequestBuilder partialSubmit(boolean value, boolean partialSubmitSet, String partialSubmitFilter) { PrimeConfiguration config = RequestContext.getCurrentInstance(context).getApplicationContext().getConfig(); //component can override global setting boolean partialSubmit = partialSubmitSet ? value : config.isPartialSubmitEnabled(); if (partialSubmit) { buffer.append(",ps:true"); if (partialSubmitFilter != null) { buffer.append(",psf:\"").append(partialSubmitFilter).append("\""); } } return this; }
public void compareVersionDifferences() { RequestContext requestContext = RequestContext.getCurrentInstance(); if (this.selectedVersions.size() != 2) { requestContext.execute("openCompareTwo();"); } else { //order depends on order of selection - needs to be chronological order if (this.selectedVersions.get(0).getId().intValue() > this.selectedVersions.get(1).getId().intValue()) { updateVersionDifferences(this.selectedVersions.get(0), this.selectedVersions.get(1)); } else { updateVersionDifferences(this.selectedVersions.get(1), this.selectedVersions.get(0)); } } }
@Deprecated public AjaxRequestBuilder partialSubmit(boolean value, boolean partialSubmitSet) { PrimeConfiguration config = RequestContext.getCurrentInstance(context).getApplicationContext().getConfig(); //component can override global setting boolean partialSubmit = partialSubmitSet ? value : config.isPartialSubmitEnabled(); if (partialSubmit) { buffer.append(",ps:true"); } return this; }
protected void addAttachedObjectHandlerToMojarra(UIComponent component) { String key = MOJARRA_ATTACHED_OBJECT_HANDLERS_KEY; if (RequestContext.getCurrentInstance().getApplicationContext().getConfig().isAtLeastJSF22()) { key = MOJARRA_22_ATTACHED_OBJECT_HANDLERS_KEY; } Map<String, Object> attrs = component.getAttributes(); List<AttachedObjectHandler> result = (List<AttachedObjectHandler>) attrs.get(key); if (result == null) { result = new ArrayList<AttachedObjectHandler>(); attrs.put(key, result); } result.add(this); }
@Override public void release() { RequestContext requestContext = RequestContext.getCurrentInstance(wrapped); if (requestContext != null) { requestContext.release(); } super.release(); } }
public static boolean isRTL(FacesContext context, RTLAware component) { boolean globalValue = RequestContext.getCurrentInstance(context).isRTL(); return globalValue || component.isRTL(); }
public AjaxRequestBuilder resetValues(boolean value, boolean resetValuesSet) { PrimeConfiguration config = RequestContext.getCurrentInstance(context).getApplicationContext().getConfig(); //component can override global setting boolean resetValues = resetValuesSet ? value : config.isResetValuesEnabled(); if (resetValues) { buffer.append(",rv:true"); } return this; }
protected String resolveTheme(FacesContext context) { String theme = null; String themeConfigValue = RequestContext.getCurrentInstance(context).getApplicationContext().getConfig().getMobileTheme(); if (themeConfigValue != null) { ELContext elContext = context.getELContext(); ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory(); ValueExpression ve = expressionFactory.createValueExpression(elContext, themeConfigValue, String.class); theme = ve.isLiteralText() ? themeConfigValue : (String) ve.getValue(elContext); } return theme; }
public PrimeResource(final Resource resource) { super(); wrapped = resource; version = "&v=" + RequestContext.getCurrentInstance().getApplicationContext().getConfig().getBuildVersion(); }
public static boolean isSkipIteration(VisitContext visitContext, FacesContext context) { if (RequestContext.getCurrentInstance(context).getApplicationContext().getConfig().isAtLeastJSF21()) { return visitContext.getHints().contains(VisitHint.SKIP_ITERATION); } else { Boolean skipIterationHint = (Boolean) visitContext.getFacesContext().getAttributes().get(SKIP_ITERATION_HINT); return skipIterationHint != null && skipIterationHint.booleanValue() == true; } }
protected void renderDynamicPassThruAttributes(FacesContext context, UIComponent component) throws IOException { if (RequestContext.getCurrentInstance(context).getApplicationContext().getConfig().isAtLeastJSF22()) { Jsf22Helper.renderPassThroughAttributes(context, component); } }
public String startWorldMapDownloadLink(GuestbookResponse guestbookResponse, FileMetadata fmd){ RequestContext requestContext = RequestContext.getCurrentInstance(); boolean valid = validateGuestbookResponse(guestbookResponse); if (!valid) { return ""; } guestbookResponse.setDownloadtype("WorldMap"); String retVal = fileDownloadService.startWorldMapDownloadLink(guestbookResponse, fmd); requestContext.execute("PF('downloadPopup').hide()"); return retVal; }
public void create() { ViewState state = viewStateHolder.createNewState(); viewStateHolder.registerState(state); this.activeViewId = state.getId(); if (log.isInfoEnabled()) { log.info("Created a new view state : {}", state.getId()); } RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.addCallbackParam("report", new JSONObject(new ViewInfo(state))); }
public void writeGuestbookAndOpenSubset(GuestbookResponse guestbookResponse) { RequestContext requestContext = RequestContext.getCurrentInstance(); boolean valid = validateGuestbookResponse(guestbookResponse); if (!valid) { } else { requestContext.execute("PF('downloadPopup').hide()"); requestContext.execute("PF('downloadDataSubsetPopup').show()"); guestbookResponse.setDownloadtype("Subset"); fileDownloadService.writeGuestbookResponseRecord(guestbookResponse); } }
@Override public void processEvent(SystemEvent event) throws AbortProcessingException { try { if (event instanceof PreRenderComponentEvent) { PreRenderComponentEvent preRenderComponentEvent = (PreRenderComponentEvent) event; execute(RequestContext.getCurrentInstance().getApplicationContext().getConfig(), preRenderComponentEvent.getComponent()); } } catch (IOException e) { throw new FacesException(e); } }
protected void encodeScript(final FacesContext context, final TriStateCheckbox checkbox) throws IOException { WidgetBuilder wb = RequestContext.getCurrentInstance(context).getWidgetBuilder(); wb.initWithDomReady("TriStateCheckbox", checkbox.resolveWidgetVar(), checkbox.getClientId()); encodeClientBehaviors(context, checkbox); wb.finish(); } }
protected void encodeScript(FacesContext context, InputNumber inputNumber, Object value, String valueToRender) throws IOException { WidgetBuilder wb = RequestContext.getCurrentInstance(context).getWidgetBuilder(); wb.initWithDomReady(InputNumber.class.getSimpleName(), inputNumber.resolveWidgetVar(), inputNumber.getClientId()); wb.attr("disabled", inputNumber.isDisabled()) .attr("valueToRender", formatForPlugin(valueToRender, inputNumber, value)); String metaOptions = getOptions(inputNumber); if (!metaOptions.isEmpty()) { wb.nativeAttr("pluginOptions", metaOptions); } wb.finish(); }
public void writeGuestbookAndLaunchPackagePopup(GuestbookResponse guestbookResponse) { RequestContext requestContext = RequestContext.getCurrentInstance(); boolean valid = validateGuestbookResponse(guestbookResponse); if (!valid) { JH.addMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("dataset.message.validationError")); } else { requestContext.execute("PF('downloadPopup').hide()"); requestContext.execute("PF('downloadPackagePopup').show()"); requestContext.execute("handleResizeDialog('downloadPackagePopup')"); fileDownloadService.writeGuestbookResponseRecord(guestbookResponse); } }
@Override public Converter getConverter() { Converter converter = super.getConverter(); if(converter == null && RequestContext.getCurrentInstance(getFacesContext()).getApplicationContext().getConfig().isClientSideValidationEnabled()) { DateTimeConverter con = new DateTimeConverter(); con.setPattern(this.calculatePattern()); con.setTimeZone(this.calculateTimeZone()); con.setLocale(this.calculateLocale(getFacesContext())); return con; } return converter; }