Home > FAQs > Cookbook > Tabular inputs with HashMap

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)

or

DisplayTag (server side)

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.