You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Colic <al...@pop-ware.com> on 2001/06/06 22:49:28 UTC

viewing combo box

Hi,

lets say you have a combo box filling from a vector. I can get this to work
but I don't want the combo box to show if there are no options in it. In
other words if the vector=0. What the best way to do this.

Thanks for the help.

Alex

Re: viewing combo box

Posted by William Jaynes <wj...@mediaone.net>.
Easiest thing is to have a propery in your ActionForm that tests whether
the combo box is empty or not. Then in your jsp you'll need to surround
the select/option tags with a logic tag of some kind, like

<logic:equal name="form" property="comboEmpty" value="false">
...
</logic:equal>

----- Original Message -----
From: "Alex Colic" <al...@pop-ware.com>
To: "Struts" <st...@jakarta.apache.org>
Sent: Wednesday, June 06, 2001 4:49 PM
Subject: viewing combo box


> Hi,
>
> lets say you have a combo box filling from a vector. I can get this to
work
> but I don't want the combo box to show if there are no options in it.
In
> other words if the vector=0. What the best way to do this.
>
> Thanks for the help.
>
> Alex
>


Re: viewing combo box

Posted by Martin Cooper <ma...@tumbleweed.com>.
If you need to test for the property value being null, you can use the
<logic:present> tag. If you need to test for a vector which exists but which
has no elements, you'll have to use another field in your form, as someone
else suggested, or use scriptlets in your page. (A better way of handling
this should appear in Struts 1.1 before too long.)

--
Martin Cooper


----- Original Message -----
From: "Alex Colic" <al...@pop-ware.com>
To: "Struts" <st...@jakarta.apache.org>
Sent: Wednesday, June 06, 2001 1:49 PM
Subject: viewing combo box


> Hi,
>
> lets say you have a combo box filling from a vector. I can get this to
work
> but I don't want the combo box to show if there are no options in it. In
> other words if the vector=0. What the best way to do this.
>
> Thanks for the help.
>
> Alex
>
>