Re: Doubt with using check box

2009-06-22 Thread Luis Ureña
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














Problem creating multiple radio buttons groups into an logic:iterate

2009-06-22 Thread Luis Ureña
First, thanks for your help

I am having problems to build JSP with multiple questions and some radio
buttons for each question.

I am using two logic:iterate, one for questions and anotherone for answer
for each question, like this:

 logic:iterate id=questions name=unicaBean indexId=index
TR id=trdark
TD
html:hidden name=questions property=seccion/
html:hidden name=questions property=pregunta/
bean:write name=questions property=descPregunta/
/TD
/TR
TR id=trclear
TD
table class=tableinfo
tr
td
logic:iterate id=answers name=questions
property=opciones
html:radio name=answers property=name
value=id idName=answers indexed=true/
bean:write name=answers property=name/
/logic:iterate
/td
/tr
/table
/TD
/TR
/logic:iterate


Form survey problem (html:radio)

2009-06-19 Thread Luis Ureña
I am working in a survey form with several questions. Each question can have
several options. That options are builded with an iterate. When I execute
the page generate one radio button name. If I add the indexed=Yes property
for the html:radio this generate one radio button name for all the first
option for all the questions, another radio button name for all second
options for all questions, and so on.

tr
td
input type=radio name=opcion[0].name value=1pangea
input type=radio name=opcion[1].name value=2oceania
input type=radio name=opcion[2].name value=3panthalasa
input type=radio name=opcion[3].name value=4euroasiatico
input type=radio name=opcion[4].name value=4De relleno
/td
/tr
tr
td
input type=radio name=opcion[0].name value=3Arcaicas
input type=radio name=opcion[1].name value=2Nuevas
input type=radio name=opcion[2].name value=1Viejas
/td
/tr


I need generate one radio button name for all options for the first
question. Another radio button name for all options for the second question
and son on.
(unicaBean is the bean that I put into the request. opciones bean is a
Collection into unicaBean)

This is the JSP:
logic:iterate id=unicaBean name=unicaBean
TR id=trdark
TD
html:hidden name=unicaBean property=seccion/
html:hidden name=unicaBean property=pregunta/
bean:write name=unicaBean property=descPregunta/
/TD
/TR
TR id=trclear
TD
table class=tableinfo
tr
td
logic:iterate id=opcion name=unicaBean
property=opciones indexId=pregunta
html:radio name=opcion property=name
value=id idName=opcion indexed=true/
bean:write name=opcion property=name/
/logic:iterate
/td
/tr
/table
/TD
/TR
/logic:iterate



Somebody know how do it?

Thanks


Fwd: Form survey problem (html:radio)

2009-06-19 Thread Luis Ureña
I am working in a survey form with several questions. Each question can have
several options. That options are builded with an iterate. When I execute
the page generate one radio button name. If I add the indexed=Yes property
for the html:radio this generate one radio button name for all the first
option for all the questions, another radio button name for all second
options for all questions, and so on.

tr
td
input type=radio name=opcion[0].name value=1pangea
input type=radio name=opcion[1].name value=2oceania
input type=radio name=opcion[2].name value=3panthalasa
input type=radio name=opcion[3].name value=4euroasiatico
input type=radio name=opcion[4].name value=4De relleno
/td
/tr
tr
td
input type=radio name=opcion[0].name value=3Arcaicas
input type=radio name=opcion[1].name value=2Nuevas
input type=radio name=opcion[2].name value=1Viejas
/td
/tr


I need generate one radio button name for all options for the first
question. Another radio button name for all options for the second question
and son on.
(unicaBean is the bean that I put into the request. opciones bean is a
Collection into unicaBean)

This is the JSP:
logic:iterate id=unicaBean name=unicaBean
TR id=trdark
TD
html:hidden name=unicaBean property=seccion/
html:hidden name=unicaBean property=pregunta/
bean:write name=unicaBean property=descPregunta/
/TD
/TR
TR id=trclear
TD
table class=tableinfo
tr
td
logic:iterate id=opcion name=unicaBean
property=opciones indexId=pregunta
html:radio name=opcion property=name
value=id idName=opcion indexed=true/
bean:write name=opcion property=name/
/logic:iterate
/td
/tr
/table
/TD
/TR
/logic:iterate



Somebody know how do it?

Thanks


Form survey problem (html:radio)

2009-06-19 Thread Luis Ureña
I am working in a survey form with several questions. Each question can have
several options. That options are builded with an iterate. When I execute
the page generate one radio button name. If I add the indexed=Yes property
for the html:radio this generate one radio button name for all the first
option for all the questions, another radio button name for all second
options for all questions, and so on.

tr
td
input type=radio name=opcion[0].name value=1pangea
input type=radio name=opcion[1].name value=2oceania
input type=radio name=opcion[2].name value=3panthalasa
input type=radio name=opcion[3].name value=4euroasiatico
input type=radio name=opcion[4].name value=4De relleno
/td
/tr
tr
td
input type=radio name=opcion[0].name value=3Arcaicas
input type=radio name=opcion[1].name value=2Nuevas
input type=radio name=opcion[2].name value=1Viejas
/td
/tr


I need generate one radio button name for all options for the first
question. Another radio button name for all options for the second question
and son on.
(unicaBean is the bean that I put into the request. opciones bean is a
Collection into unicaBean)

This is the JSP:
logic:iterate id=unicaBean name=unicaBean
TR id=trdark
TD
html:hidden name=unicaBean property=seccion/
html:hidden name=unicaBean property=pregunta/
bean:write name=unicaBean property=descPregunta/
/TD
/TR
TR id=trclear
TD
table class=tableinfo
tr
td
logic:iterate id=opcion name=unicaBean
property=opciones indexId=pregunta
html:radio name=opcion property=name
value=id idName=opcion indexed=true/
bean:write name=opcion property=name/
/logic:iterate
/td
/tr
/table
/TD
/TR
/logic:iterate



Somebody know how do it?

Thanks