use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class EntitiesViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event, false);
resetButtonState(TBL_BUTTON_DELETE);
EntitiesModel model = (EntitiesModel) getModel();
CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if (model.repoExists(curRealm)) {
b.setDisabled(false);
} else {
b.setDisabled(true);
}
String[] param = { getDisplayIDType() };
ptModel.setPageTitleText(MessageFormat.format(model.getLocalizedString("page.title.entities"), (Object[]) param));
tblModel.setTitle(MessageFormat.format(model.getLocalizedString("table.entities.title.name"), (Object[]) param));
tblModel.setTitleLabel(MessageFormat.format(model.getLocalizedString("table.entities.title.name"), (Object[]) param));
tblModel.setSummary(MessageFormat.format(model.getLocalizedString("table.entities.summary"), (Object[]) param));
getEntityNames();
addEntitiesTab();
tabModel.setSelectedNode(7);
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class EntitiesViewBean method getEntityNames.
private void getEntityNames() {
EntitiesModel model = (EntitiesModel) getModel();
String filter = ((String) getDisplayFieldValue(TF_FILTER));
if ((filter == null) || (filter.length() == 0)) {
filter = "*";
setDisplayFieldValue(TF_FILTER, "*");
} else {
filter = filter.trim();
}
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
IdSearchResults results = model.getEntityNames(curRealm, getDisplayIDType(), filter);
int errorCode = results.getErrorCode();
switch(errorCode) {
case IdSearchResults.SIZE_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
break;
case IdSearchResults.TIME_LIMIT_EXCEEDED:
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
break;
}
populateTableModel(results.getSearchResults());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
// disable the add button if there was an error
CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
b.setDisabled(true);
}
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class PolicyReferralViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
try {
populateAttributes();
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if (model.getActiveReferralTypes(realmName).isEmpty()) {
CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
btn.setDisabled(true);
}
CCButton btn = (CCButton) getChild("tblReferralsButtonDelete");
btn.setDisabled(true);
} catch (AMConsoleException e) {
CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
btn.setDisabled(true);
btn = (CCButton) getChild("tblReferralsButtonDelete");
btn.setDisabled(true);
}
}
use of com.sun.web.ui.view.html.CCButton in project OpenAM by OpenRock.
the class FSSAMLSetTrustedPartnerTypeViewBean method enableButton.
protected void enableButton() {
CCButton btnBack = (CCButton) getChild("button1");
btnBack.setDisabled(false);
}
Aggregations