Home > FAQs > Cookbook > Tabular inputs with HashMap |

Apache Struts 2 Documentation
Tabular inputs with HashMap
Edit Page Browse Space Add Page Add News

## Intro

I have a need to enter tabular data, like marks from a list of examination candidates.

This is how it's done :

the mark.vm file..

the SaveMarksAction

## Explanation

The resulting vm file is rendered as

Webwork will populate the marks into the Map marks via

whereby you can get the list of candidateIds via

and the individual marks via

## Possible enhancements

Couple tabular inputs with some sortable table component (javascript, client side)

- http://webfx.eae.net/dhtml/sortabletable/sortabletable.html

or

DisplayTag (server side)

- http://displaytag.sourceforge.net/
- http://www.displaytag.org/index.jsp

I believe there's some discussion on the mailing list about using Ognl to handle it automatically. I didn't follow it in detail, but from what I know, (do correct me if I'm wrong) the Ognl method is not available yet. The above works for now.

## Conclusion

Feedback, comments and suggestions on better methods to perform the same function are welcome. If there's a simpler way, or a customised component to handle this tabular input automatically, I believe it'll be very useful.