You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajeshwari Godbole <rg...@gmail.com> on 2009/02/16 06:40:54 UTC

Re: Hiding s:select control: SOLVED!

Hi,

Thanks for your help, Sonny and Pawel. Specifying an id attribute did not
work as that just hid the dropbox itself but still showed the label so that
looked weird, but setting the theme to simple worked. So I had to write my
own <tr> and <td>'s and draw the table but I set the theme for all the tags
in the form to "simple" and used javascript to hide the entire row for the
field.

Thanks again for your help!

Rajeshwari

On Tue, Feb 10, 2009 at 3:24 PM, Sonny Gill <so...@gmail.com> wrote:

> Whether or not the <tr> and <td> s are created depend on the theme see
> are using for the form.
> See http://struts.apache.org/2.0.14/docs/form.html
> If you use the 'simple' theme, no extra html elements will be created.
> See http://struts.apache.org/2.0.14/docs/themes-and-templates.html
>
> Setting the element's style.display to 'none' should work. If it is
> not working, you need to debug the Javascript code that you are
> adding, that is not due to Struts.
>
> Cheers,
> Sonny
>
>
> On Tue, Feb 10, 2009 at 1:20 PM, Rajeshwari Godbole <rg...@gmail.com>
> wrote:
> > Hello all,
> >
> > I'm using Struts2 on Tomcat and am trying to hide a s:select tag
> depending
> > on the selected option of another s:select tag. I'm able to disable the
> tag
> > using javascript but am not able to hide it. Setting
> style.display="none";
> > does not work, neither does adding a div tag because Struts writes its
> own
> > <tr><td>'s and the div tag is placed somewhere else. Is there a way to do
> > this? Could struts be told not to create <tr> and <td> fields?
> >
> > Any help is much appreciated.
> >
> > Thanks,
> >
> > Rajeshwari
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Hiding s:select control: SOLVED!

Posted by Rajeshwari Godbole <rg...@gmail.com>.
Mitch,

I think the question may have been directed at you as you indicated in your
email that if ajax was required, then setting the form theme to simple may
not work?

Thanks for the form tip, it sure would make the code better :)

Thanks,
Rajeshwari

On Tue, Feb 17, 2009 at 7:19 PM, mitch gorman <mg...@shadowtv.biz> wrote:

> Martin Gainty wrote:
> > glad to hear simple theme worked for you..
> > i'm wondering if you can produce inconsistent results wihen theme='ajax'
> if so you found a BUG
> > can you display a small snippet of your jsp?
> >
> >
> >>     didn't see the original post, so i'm not sure if ajax was required
> >> (in which case what i'm about to say should be disregarded), but just
> >> setting the theme to simple for the form element itself will propagate
> >> it to all the individual inputs within the form... no need to put
> >> 'theme="simple"' on each tag... improved readability of the code is a
> >> Good Thing(tm).
> >>
>     are you asking me, or Rajeshwari?  all i'm saying is
>
> <s:form theme="simple"...>
>    <s:textfield ...>
>    <s:textfield ...>
>    <s:select ...>
>    ...
>
>    is better than
>
> <s:form ...>
>    <s:textfield theme="simple" ...>
>    <s:textfield theme="simple" ...>
>    <s:select theme="simple" ...>
>   ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Hiding s:select control: SOLVED!

Posted by mitch gorman <mg...@shadowtv.biz>.
Martin Gainty wrote:
> glad to hear simple theme worked for you..
> i'm wondering if you can produce inconsistent results wihen theme='ajax' if so you found a BUG
> can you display a small snippet of your jsp?
>
>   
>>     didn't see the original post, so i'm not sure if ajax was required
>> (in which case what i'm about to say should be disregarded), but just
>> setting the theme to simple for the form element itself will propagate
>> it to all the individual inputs within the form... no need to put
>> 'theme="simple"' on each tag... improved readability of the code is a
>> Good Thing(tm).
>>     
    are you asking me, or Rajeshwari?  all i'm saying is

<s:form theme="simple"...>
    <s:textfield ...>
    <s:textfield ...>
    <s:select ...>
    ...

    is better than

<s:form ...>
    <s:textfield theme="simple" ...>
    <s:textfield theme="simple" ...>
    <s:select theme="simple" ...>
   ...


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


RE: Hiding s:select control: SOLVED!

Posted by Martin Gainty <mg...@hotmail.com>.
glad to hear simple theme worked for you..
i'm wondering if you can produce inconsistent results wihen theme='ajax' if so you found a BUG
can you display a small snippet of your jsp?

thanks,
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Mon, 16 Feb 2009 12:35:40 -0500
> From: mgorman@shadowtv.biz
> To: user@struts.apache.org
> Subject: Re: Hiding s:select control: SOLVED!
> 
> Rajeshwari Godbole wrote:
> > So I had to write my
> > own <tr> and <td>'s and draw the table but I set the theme for all the tags
> > in the form to "simple" 
> 
>     didn't see the original post, so i'm not sure if ajax was required
> (in which case what i'm about to say should be disregarded), but just
> setting the theme to simple for the form element itself will propagate
> it to all the individual inputs within the form... no need to put
> 'theme="simple"' on each tag... improved readability of the code is a
> Good Thing(tm).
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Re: Hiding s:select control: SOLVED!

Posted by mitch gorman <mg...@shadowtv.biz>.
Rajeshwari Godbole wrote:
> So I had to write my
> own <tr> and <td>'s and draw the table but I set the theme for all the tags
> in the form to "simple" 

    didn't see the original post, so i'm not sure if ajax was required
(in which case what i'm about to say should be disregarded), but just
setting the theme to simple for the form element itself will propagate
it to all the individual inputs within the form... no need to put
'theme="simple"' on each tag... improved readability of the code is a
Good Thing(tm).


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