public void save() { RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.execute("dialog.hide()"); }
@Stateless public class SomeServiceImpl implements SomeService { @Asynchronous public void asyncTask(RequestContext context) { // ... context.execute("PF('dlg1').hide()"); } }
<h:form id="myForm"> ... </h:form> @ManagedBean @RequestScoped public class MrBean { public void doSomething() { // Do your thing RequestContext context = RequestContext.getCurrentInstance(); context.execute("document.getElementById("myForm").reset()"); } }
public void myAction(ComponentSystemEvent componentSystemEvent) { RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.execute("alert('wow')"); }
private void doSomething() { RequestContext ctx = RequestContext.getCurrentInstance(); ctx.execute("PF('myOverlayPanel').hide();"); }
public void sessionIdleListener() { RequestContext context = RequestContext.getCurrentInstance(); context.execute("sessionExpiredConfirmation.show()"); }
public void doSomething(ActionEvent actionEvent) { RequestContext context = RequestContext.getCurrentInstance(); context.execute("jQuery('#IdOfThePanel').hide()"); }
RequestContext context = RequestContext.getCurrentInstance(); context.execute("alert('hello from bean');");
RequestContext context = RequestContext.getCurrentInstance(); context.execute("renderTheChart(" + tabIndex + ");");
public void validate() { if(mode.equals("1")) { System.out.println("OK"); } else { RequestContext context = RequestContext.getCurrentInstance(); context.execute("PF('confirmButton').jq.click();"); } }
if (condition is true) { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); externalContext.redirect("other-page.xhtml"); } else { RequestContext context = RequestContext.getCurrentInstance(); context.execute("myDialog.show();"); //assuming you have set the widgetVar on your dialog to "myDialog" }
public void openDownloadPopupForMultipleFileDownload() { if (this.selectedFiles.isEmpty()) { RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.execute("PF('selectFilesForDownload').show()"); return; } // There's a chance that this is not really a batch download - i.e., // there may only be one file on the downloadable list. But the fileDownloadService // method below will check for that, and will redirect to the single download, if // that's the case. -- L.A. this.guestbookResponse.setDownloadtype("Download"); RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.execute("PF('downloadPopup').show();handleResizeDialog('downloadPopup');"); }
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); } }
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); } }
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)); } } }
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; }
/** * @see org.pivot4j.ui.command.BasicDrillThroughCommand#execute(org.pivot4j.PivotModel, * org.pivot4j.ui.command.UICommandParameters) */ @Override public ResultSet execute(PivotModel model, UICommandParameters parameters) { int[] array = parameters.getCellCoordinate(); List<Integer> coords = Arrays.asList(ArrayUtils.toObject(array)); Cell cell = model.getCellSet().getCell(coords); drillThroughHandler.update(cell); RequestContext context = RequestContext.getCurrentInstance(); context.update("drillthrough-form"); context.execute("PF('drillThroughDialog').show()"); return null; } }