Search in sources :

Example 1 with UMUserPasswordResetOptionsData

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());
        }
    }
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) Iterator(java.util.Iterator) UMUserPasswordResetOptionsData(com.sun.identity.console.user.model.UMUserPasswordResetOptionsData)

Example 2 with UMUserPasswordResetOptionsData

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;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) UMUserPasswordResetOptionsData(com.sun.identity.console.user.model.UMUserPasswordResetOptionsData)

Example 3 with UMUserPasswordResetOptionsData

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;
}
Also used : UMUserPasswordResetOptionsData(com.sun.identity.console.user.model.UMUserPasswordResetOptionsData)

Aggregations

UMUserPasswordResetOptionsData (com.sun.identity.console.user.model.UMUserPasswordResetOptionsData)3 SerializedField (com.sun.identity.console.components.view.html.SerializedField)2 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 Iterator (java.util.Iterator)1 List (java.util.List)1