You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Stewart <ks...@elp.rr.com> on 2004/07/15 20:53:43 UTC
html:image question
How can I pass parameters in a <html:image tag.
I have four of these that will basically do the same thing, issue a
query. But, the query is parameterized.
It make little sense to do it the Husted way and have multiple image
bean buttons to represent which html:image
was selected. IMHO, that approach is too much like hard coding. Any
suggestions would be greatly appreciated.
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:image question
Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 02:26 PM 7/15/2004, you wrote:
> <crackwillow:image
> button='GO.gif'
> mapBean='host'
> bgClr='FFFFFF'
> txtClr='000000'
> font='Eurostile'
> italic='false'
> bold='true'
> size='20'
> property='button.go/>
I should not have had the attribute mapBean in this tag. That only goes
with dynamic colors and the attributes bgClrCode and
txtClrCode. Sorry! The real code is:
<crackwillow:image
button='GO.gif'
bgClr='FFFFFF'
txtClr='000000'
font='Eurostile'
italic='false'
bold='true'
size='20'
property='button.go/>
Sorry!
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:image question
Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 11:53 AM 7/15/2004, you wrote:
>How can I pass parameters in a <html:image tag.
http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript
If you do the coding on this one time, you merely have to add a new button
when you want one in command class ButtonOperation. After a while, you
will have to do no coding at all. Actually, I have built a taglib
utilizing this Multiple Image Button "scenario" that looks like the
following on the page:
<crackwillow:image
button='GO.gif'
mapBean='host'
bgClr='FFFFFF'
txtClr='000000'
font='Eurostile'
italic='false'
bold='true'
size='20'
property='button.go/>
This extends Struts's html SubmitTag and replaces Struts's html
ImageTag. The button attribute is internationalized with message resources
and makes fonts in whatever language you want on the fly. The results are
cached, so that there is no need to have a "src" attribute that is exposed,
even though there is one internally. All the page author has to do is to
put this on the page and the button appears automagically. There are also
bgClrCode and txtClrCode attributes that make it possible to assign dynamic
values to the colors of the background and the text of the image. If the
image is Chinese, etc, a suitable alternate font to the one chosen is
automatically subsituted.
This something like what you are interested in?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:image question
Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 11:53 AM 7/15/2004, you wrote:
>It make little sense to do it the Husted way and have multiple image
>bean buttons to represent which html:image
>was selected. IMHO, that approach is too much like hard coding.
I for one cannot imagine why you would want a button value to be dynamic
other than to present i18n options or other image issues. I cannot, that
is, imagine why you would not want the issue of whether it was a "submit"
or "reset" or "clear" etc. button to be dynamic. Maybe you have a use case
I am not thinking about. IMHO that the only thing you need to have dynamic
is the content, not the function of the button, e.g. to make what the
button looks like dynamic but what the button does static. I think this
was Ted's approach too. I mean I think Ted and I have the same approach on
that, even though this solution is a lot more convoluted than Ted's. I
should say that I am not sure which of Ted's solutions you are talking
about. He has more than one. Some use JavaScript, etc.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org