use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsData in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method populateTableModel.
private void populateTableModel(List questionAnswers) {
tblModel.clearAll();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
szCache.setValue(questionAnswers);
if ((questionAnswers != null) && !questionAnswers.isEmpty()) {
boolean firstEntry = true;
for (Iterator iter = questionAnswers.iterator(); iter.hasNext(); ) {
if (firstEntry) {
firstEntry = false;
} else {
tblModel.appendRow();
}
UMUserPasswordResetOptionsData data = (UMUserPasswordResetOptionsData) iter.next();
String question = data.getQuestionLocalizedName();
if (data.isPersonalQuestion()) {
tblModel.setValue(TBL_DATA_QUESTION, null);
tblModel.setValue(TBL_DATA_PERSONAL_QUESTION, question);
} else {
tblModel.setValue(TBL_DATA_QUESTION, question);
tblModel.setValue(TBL_DATA_PERSONAL_QUESTION, null);
}
tblModel.setRowSelected(data.isSelected());
tblModel.setValue(TBL_DATA_ANSWER, data.getAnswer());
}
}
}
use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsData in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method restoreOptionsData.
private List restoreOptionsData() throws ModelControlException {
CCActionTable table = (CCActionTable) getChild(TBL_SEARCH);
table.restoreStateData();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List optionData = (List) szCache.getSerializedObj();
int sz = optionData.size();
for (int i = 0; i < sz; i++) {
UMUserPasswordResetOptionsData data = (UMUserPasswordResetOptionsData) optionData.get(i);
tblModel.setRowIndex(i);
data.setSelected(tblModel.isRowSelected());
data.setAnswer((String) tblModel.getValue(TBL_DATA_ANSWER));
if (data.isPersonalQuestion()) {
data.setQuestion((String) tblModel.getValue(TBL_DATA_PERSONAL_QUESTION));
}
}
return optionData;
}
use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsData in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsTiledView method beginChildDisplay.
public boolean beginChildDisplay(ChildDisplayEvent event) {
super.endDisplay(event);
boolean display = true;
int rowIndex = model.getRowIndex();
if (rowIndex < model.getNumRows()) {
String childName = event.getChildName();
UMUserPasswordResetOptionsData data = getUserPasswordResetOptionsData(rowIndex);
boolean isPersonalQuestion = data.isPersonalQuestion();
if (childName.equals(UMUserPasswordResetOptionsViewBean.TBL_DATA_PERSONAL_QUESTION)) {
display = isPersonalQuestion;
} else if (childName.equals(UMUserPasswordResetOptionsViewBean.TBL_DATA_QUESTION)) {
display = !isPersonalQuestion;
}
}
return display;
}
Aggregations