Using a Map won’t work, primarily because the Ognl language doesn’t support the syntax you are looking for. If we can ever get a hold of Drew Davidson (Ognl owner) we might be able to get support for this some day J

 

In the meantime, I’d recommend you use a List of Row objects where Row has two fields: key and value.

 

Then in YourAction-conversion.properties you’d have:

 

Collection_someList = com.acme.Row

 

And your HTML elements would have names like “someList[0].key” and “someList[0].value”.

 

Patrick

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Payne
Sent:
Monday, February 16, 2004 6:09 PM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] Populating HashMaps (Maps) from a post

 

I saw this entry on the wiki.

http://wikiopensymphony.com/comments/Tabular+inputs

How would you set this up if you did not know the keys ahead of time.
Namely, for every entry there would be two text boxs, the "key" and the actual "value"

The example does:
<input type="text" name="marks['candidateId1']" value="4" size="3"/>
Where 'candidateId1' is the key. 

How would this be expressed if the user was supposed to supply the keys?
?????
<input type="text" name="marks[].key" value="4" size="3"/>
<input type="text" name="marks[].value" value="4" size="3"/>

Thanks

--
Matthew Payne <[EMAIL PROTECTED]>

 

Reply via email to