I think this is more
JSP related than
struts specificaly, since what I am needing to do is in the JSP page.
I have my struts framework all set up, but I'm struggling with the page design and functionality. I have a jsp page, which is displaying a table. I need to be able to highlight and select exclusively a single row in the table when the row is clicked, and save that index in my ActionForm object. (I have a value in my ActionForm which will be a placeholder for the index).
I have the table displaying my list by using <logic:iterate>, but I have no idea how to get the row to "highlight" as selected, and save the index of the row into the ActionForm.
I've found some examples of using JavaScript to do the row highlighting, but I'm having second thoughts as to whether using JavaScript is the best way or if there is an alternative way using Struts tags, I'm willing to give that a try.
Here is some code:
My ActionForm:
in my jsp page, I am displaying the table:
Should I use JavaScript? Alternatives? This displays my table, but I need some guidance on how to do the row selection and row highlighting when the row is clicked.