use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SMG11NViewBean method handleTblSupportedCharsetsButtonDeleteRequest.
/**
* Handles remove supported container request.
*
* @param event Request Invocation Event.
*/
public void handleTblSupportedCharsetsButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS);
tblValues.removeAll(selected);
setPageSessionAttribute(SMG11NModelImpl.ATTRIBUTE_NAME_SUPPORTED_CHARSETS, tblValues);
populateSupportedCharsetsTable(tblValues);
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class ServerConfigXMLViewBean method handleTblServerConfigXMLUserButtonDeleteRequest.
/**
* Handles remove server group entry request.
*
* @param event Request invocation event
*/
public void handleTblServerConfigXMLUserButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
String serverName = (String) getPageSessionAttribute(ServerEditViewBeanBase.PG_ATTR_SERVER_NAME);
ServerSiteModel model = (ServerSiteModel) getModel();
try {
ServerConfigXML xmlObj = model.getServerConfigObject(serverName);
ServerConfigXML.ServerGroup defaultServerGroup = xmlObj.getDefaultServerGroup();
CCActionTable table = (CCActionTable) getChild(TBL_USERS);
table.restoreStateData();
Integer[] selected = tblUserModel.getSelectedRows();
if (selected.length >= defaultServerGroup.hosts.size()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("exception.cannot,delete.all.servers"));
} else {
for (int i = selected.length - 1; i >= 0; --i) {
defaultServerGroup.hosts.remove(selected[i].intValue());
}
model.setServerConfigXML(serverName, xmlObj.toXML());
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class STSHomeViewBean method handleTblSoapSTSInstancesButtonDeleteRequest.
public void handleTblSoapSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SOAP_STS_INSTANCES);
table.restoreStateData();
Integer[] selected = tblModelSoapSTSInstances.getSelectedRows();
Set<String> instanceNames = new HashSet<>(selected.length);
for (int i = 0; i < selected.length; i++) {
tblModelSoapSTSInstances.setRowIndex(selected[i].intValue());
instanceNames.add((String) tblModelSoapSTSInstances.getValue(TBL_SOAP_STS_INSTANCES_DATA_NAME));
}
try {
STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
model.deleteInstances(STSType.SOAP, instanceNames);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instance.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instances.deleted");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class WSPersonalProfileServiceViewBean method handleTblSupportedContainerButtonDeleteRequest.
/**
* Handles remove supported container request.
*
* @param event Request Invocation Event.
*/
public void handleTblSupportedContainerButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
setSubmitCycle(true);
CCActionTable table = (CCActionTable) getChild(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
table.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
Integer[] selected = tblModel.getSelectedRows();
if ((selected != null) && (selected.length > 0)) {
OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
tblValues.removeAll(selected);
setPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS, tblValues);
populateSupportedContainersTable(tblValues);
}
resetButtonState(TBL_SUPPORTED_CONTAINER_DELETE_BTN);
forwardTo();
}
use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.
the class SMProfileViewBean method createChild.
/**
* Creates user interface components used by this view bean.
*
* @param name of component
* @return child component
*/
protected View createChild(String name) {
View view = null;
if (name.equals(TBL_SESSIONS)) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel((List) szCache.getSerializedObj());
view = new CCActionTable(this, tblModel, name);
} else if (name.equals(PAGETITLE)) {
view = new CCPageTitle(this, ptModel, name);
} else if (tblModel.isChildSupported(name)) {
view = tblModel.createChild(this, name);
} else if (name.equals(CHILD_SERVER_NAME_MENU)) {
view = new CCDropDownMenu(this, name, null);
} else if (name.equals(LOGOUT_URL)) {
return new CCStaticTextField(this, LOGOUT_URL, "");
} else if (name.equals(CHILD_SERVER_NAME_HREF)) {
view = new CCHref(this, name, null);
} else {
view = super.createChild(name);
}
return view;
}
Aggregations