Hi,I have modal web dialog window and I would like to close it programatically.
I can "close" dialog window (setWindowState("hidden")) but I don't know how to blur main window again?
I want this for the following scenario: there is table with bindings. User clicks for adding new binding -> modal dialog appears. User selects bindings and when clicks on "add" button then modal window should close. All is AJAX-based.
Thank you,
Anect
Hi, Anect!
Regards!
Hi,
I'm maybe inattentive but there is handling with Javascript in the samples only and I would like to handle pop-up window via Java API. As I wrote previously I need the following:
1) user opens pop-up with data table and selects some rows. Then click on the button that is defined as follows:
<ig:link iconUrl="images/icon_add_binding.gif" immediate="true" smartRefreshIds="groupMembershipTable, agListTable, agPopup" actionListener="#{assetController.chooseAssetGroupsListener}" />
2) this is mentioned listener that adds selected rows (objects) into data table in parent window, deselects selected rows and should close pop-up window. But closing doesn't work as I would expect.
public void chooseAssetGroupsListener(ActionEvent event) { RowItem rowItem; Iterator selectedRows = agGridUI.getSelectedRows().iterator(); while (selectedRows.hasNext()) { rowItem = (RowItem) selectedRows.next(); //get asset group id Long agId = (Long)GridView.getDataKeyValue(rowItem); //add asset group into AssetGroup ag = assetService.getAssetGroup(agId); asset.getGroups().add(ag); } //end-while //deselect selected rows (for showing window again) selectedRows = agGridUI.getSelectedRows().iterator(); while (selectedRows.hasNext()) { rowItem = (RowItem) selectedRows.next(); rowItem.setSelected(false); } //end-while agMembershipGridUI.dataBind(); //"closing" modal window ((HtmlDialogWindow)event.getComponent().getParent().getParent()).setWindowState("hidden"); }
PETER
I suppose the usage of the setWindowState(String windowState) method is not correct in that case. According to the API Reference Guide this method sets the defined initial state of control (normal, minimized, maximized, hidden). You can refer to the API Reference Guide in the Developer's Guide for information about all other methods of the com.infragistics.faces.window.component.html.HtmlDialogWindow.
The Confirmation Dialog in our example suggests button for closing the window after making a decision. One possible solution is to add OK-button onto your dialog window.