You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by as as <sa...@yahoo.com> on 2004/03/22 15:26:41 UTC

alternatives

Hi
I tried a lot but in vain, to show a certain default in a drop down as selected, using my <select> statement as follows:
<select name="completeName">
 <logic:iterate id="teacher" name="teachers"> 
 <option value="<bean:write name="teacher" property ="SSN"/>">
  <bean:write name="teacher" property ="completeName"/>
 </option>
  </logic:iterate>
  </select>
 
Looking for alternatives on how to implement the same: (probably using no struts tag)
 
Any help appreciated.
Thanks,
Sam.

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: alternatives

Posted by as as <sa...@yahoo.com>.
I am using ActionForm and not DynaActionForm....
I will post back now with the actual classes...
Thanks!

Mark Lowe <ma...@talk21.com> wrote:
What does you form bean look like dyna or otherwise?

The value of teacher.getSsn() (i.e. html:options collection="teachers" 
property="ssn" ) must match the value of html:select property="teacher" 
or whatever you called it. The value of teacher must be set somewhere, 
it cant do things by magic.


On 22 Mar 2004, at 15:57, as as wrote:

> MArk,
> Thanks for the quick reply.
> Yes, I did try that tooIt shows me correctly (in System.out.println), 
> my form's default value of completeName of " teacher" but on the jsp 
> page/form bean, it shows the drop down sorted and not the selected 
> value.
> Really donno what could be wrong...?
> Thanks in advance...
> -Sam
>
> Mark Lowe wrote:
> You haven't even tried using the struts tag..
>
>
> --
> labelProperty="completeName" />
>
>
> now if the value of teacher equals one of the ssn values it will be
> selected.
>
> On 22 Mar 2004, at 15:26, as as wrote:
>
>> Hi
>> I tried a lot but in vain, to show a certain default in a drop down as
>> selected, using my statement as follows:>
>>
>> ">
>>
>>
>>
>>
>>
>> Looking for alternatives on how to implement the same: (probably using
>> no struts tag)
>>
>> Any help appreciated.
>> Thanks,
>> Sam.
>>
>> Do you Yahoo!?
>> Yahoo! Finance Tax Center - File online. File on time.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: alternatives

Posted by Mark Lowe <ma...@talk21.com>.
What does you form bean look like dyna or otherwise?

The value of teacher.getSsn() (i.e. html:options collection="teachers" 
property="ssn" ) must match the value of html:select property="teacher" 
or whatever you called it. The value of teacher must be set somewhere, 
it cant do things by magic.


On 22 Mar 2004, at 15:57, as as wrote:

> MArk,
> Thanks for the quick reply.
> Yes, I did try that tooIt shows me correctly (in System.out.println), 
> my form's default value of completeName of " teacher" but on the jsp 
> page/form bean, it shows the drop down sorted and not the selected 
> value.
> Really donno what could be wrong...?
> Thanks in advance...
> -Sam
>
> Mark Lowe <ma...@talk21.com> wrote:
> You haven't even tried using the struts tag..
>
>
> --
> labelProperty="completeName" />
>
>
> now if the value of teacher equals one of the ssn values it will be
> selected.
>
> On 22 Mar 2004, at 15:26, as as wrote:
>
>> Hi
>> I tried a lot but in vain, to show a certain default in a drop down as
>> selected, using my  statement as follows:>
>>
>> ">
>>
>>
>>
>>
>>
>> Looking for alternatives on how to implement the same: (probably using
>> no struts tag)
>>
>> Any help appreciated.
>> Thanks,
>> Sam.
>>
>> Do you Yahoo!?
>> Yahoo! Finance Tax Center - File online. File on time.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: alternatives

Posted by as as <sa...@yahoo.com>.
MArk,
Thanks for the quick reply.
Yes, I did try that tooIt shows me correctly (in System.out.println), my form's default value of completeName of " teacher" but on the jsp page/form bean, it shows the drop down sorted and not the selected value.
Really donno what could be wrong...?
Thanks in advance...
-Sam

Mark Lowe <ma...@talk21.com> wrote:
You haven't even tried using the struts tag..


--
labelProperty="completeName" />


now if the value of teacher equals one of the ssn values it will be 
selected.

On 22 Mar 2004, at 15:26, as as wrote:

> Hi
> I tried a lot but in vain, to show a certain default in a drop down as 
> selected, using my  statement as follows:>
> 
> ">
> 
> 
> 
> 
>
> Looking for alternatives on how to implement the same: (probably using 
> no struts tag)
>
> Any help appreciated.
> Thanks,
> Sam.
>
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: alternatives

Posted by Mark Lowe <ma...@talk21.com>.
You haven't even tried using the struts tag..

<html:select property="teacher">
	<html:option value="">--</html:option>
	<html:options collection="teachers" property="ssn" 
labelProperty="completeName" />
</html:select>

now if the value of teacher equals one of the ssn values it will be 
selected.

On 22 Mar 2004, at 15:26, as as wrote:

> Hi
> I tried a lot but in vain, to show a certain default in a drop down as 
> selected, using my <select> statement as follows:
> <select name="completeName">
>  <logic:iterate id="teacher" name="teachers">
>  <option value="<bean:write name="teacher" property ="SSN"/>">
>   <bean:write name="teacher" property ="completeName"/>
>  </option>
>   </logic:iterate>
>   </select>
>
> Looking for alternatives on how to implement the same: (probably using 
> no struts tag)
>
> Any help appreciated.
> Thanks,
> Sam.
>
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org