Hi Vishnu

To do that, I use javaScript as follow:

First you must have an submit button with an event to fire that submit, like
this:

<html:button property="actualizar"
onclick="submitThis();">Update</html:button>

Second, you must write a javascript function that process the submit, like
this:

function submitThis()
        var sectionSelected = 0;
        try {
            // this for determines wich radiobutton was selected
            for (i=0; i < document.sectionListFrm.section.length; i++) {
               if (document.sectionListFrm.section[i].checked) {
                  sectionSelected = document.sectionListFrm.section[i].value
                  break;
               }
            }
        } catch (e) {
            sectionSelected = 0;
        }

       document.sectionListFrm.section.value = sectionSelected;

As you can see, you must have a hidden form field to hold the
sectionSelected radio button.

Hope this help you,

Luis Ureña,



2009/6/19 Vishnu Vyasan Nelliparmbil <vis...@mun.gov.bh>

> Hi Friends,
>
> I am new to web development and struts. I have a simple question.
>
> I am using <logic:iterate> tag to iterate through a list of Employees
> and display their details.
> The list contains the Employee objects.
> Now while displaying Employee details in a table, the row is ending with
> a check box , so that the user can select employees. The check boxes are
> created dynamically since they are inside the iterate tag.
>
> Now how in Action I know that a specific employee is selected?
>
> In action form I would get whether the check box is selected or not. But
> how can I relate that to employees in list?
>
> Thanks in Advance
> vishnu
>
>
>
>
>
>
>
>
>
>
>
>

Reply via email to