use of com.iplanet.jato.model.DatasetModel in project OpenAM by OpenRock.
the class PWResetQuestionTiledView method getAnswers.
/**
* Gets the answer to the secret question
*
* @return answer to the secret question
*/
public Map getAnswers() {
Map map = Collections.EMPTY_MAP;
PWResetQuestionModel model = getModel();
try {
DatasetModel dataModel = getPrimaryModel();
int size = dataModel.getSize();
if (size > 0) {
dataModel.first();
map = new HashMap(size);
}
for (int i = 0; i < size; i++) {
HiddenField hf = (HiddenField) getChild(FLD_ATTR_NAME);
String attrName = (String) hf.getValue();
String answer = (String) getDisplayFieldValue(TF_ANSWER);
if (answer != null) {
answer = answer.trim();
}
if (answer == null || answer.length() == 0) {
missingData = true;
}
map.put(attrName, answer);
dataModel.next();
}
} catch (ModelControlException mce) {
model.debugError("PWResetQuestionTiledView.getAnswers", mce);
}
return map;
}
Aggregations