Announcement Announcement Module
Collapse
No announcement yet.
referenceData - dynamic map names Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • referenceData - dynamic map names

    Hi everyone!
    I have a little problem.
    On controller I use referenceData method to prepare special maps and then on client I use this maps in <form:radiobuttons /> tags.

    The problem is that map names are not hardcoded - they are dynamicly created, like this:

    PHP Code:
    @Override
        
    protected Map<StringMap<StringString>> referenceData(HttpServletRequest requestObject command,Errors errorsthrows Exception {
            
    Map<StringMap<StringString>> = new HashMap<StringMap<StringString>>();    
                           ...    
            for(
    QuestionTO qquestions){
                
    m.put(String.valueOf(q.getId()), createAnswersMap(q.getAnswers()));
            }
            return 
    m;        
        } 
    and then I am trying to use them on jsp:
    PHP Code:
    <c:forEach items="${questions}var="q" >            
                <
    form:radiobuttons items="${q.id}path="userAnswers"  />    
    </
    c:forEach> 
    But it doesnt work...

    PHP Code:
    java.lang.IllegalArgumentExceptionAttribute 'items' must be a Collectionan Array or a Map 
    Please advise...
Working...
X