You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Devine <jo...@comcast.net> on 2002/12/05 00:10:35 UTC

accessing value

The documentation lists a "value" attribute for the <html:image> tag,
but I can't seem to get it to do anything for me. Is this attribute of
use or just a leftover since it inherited from the <html:submit> tag?



I would like to use an <html:image> in a list of query results to
activate an action on a certain result. Each <html:image> tag would have
the same name (property="addToCollection") and the value would be the id
of the data object:

<code>
 
   <html:image page="/images/check.gif" 
                value="<%=movie.getId()%>"  
                alt="I own this movie"
                property="addToCollection" />

</code>

Of course there would be many such <html:image> tags on each page of
results each with the same name ("property") and different values. The
entire page is a form, so each of the images must submit the same form,
but with a unique value for "addToCollection".

When the button is clicked, only "addToCollection.x" and
"addToCollection.y" come through as request parameters. 

Is there a way to access the value? 

Or do I have to go with javascript or something else?

TIA.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing value

Posted by John Devine <jo...@comcast.net>.
Ignore this question -- browsers ignore the value of the <input
type="image">. Apparently it's used just for javascript, though I can't
see how. Guess I'll just us a link-image with a javascript submit.



-----Original Message-----
From: John Devine [mailto:johnjdevine@comcast.net] 
Sent: Wednesday, December 04, 2002 5:11 PM
To: 'Struts Users Mailing List'
Subject: accessing <html:image> value

The documentation lists a "value" attribute for the <html:image> tag,
but I can't seem to get it to do anything for me. Is this attribute of
use or just a leftover since it inherited from the <html:submit> tag?



I would like to use an <html:image> in a list of query results to
activate an action on a certain result. Each <html:image> tag would have
the same name (property="addToCollection") and the value would be the id
of the data object:

<code>
 
   <html:image page="/images/check.gif" 
                value="<%=movie.getId()%>"  
                alt="I own this movie"
                property="addToCollection" />

</code>

Of course there would be many such <html:image> tags on each page of
results each with the same name ("property") and different values. The
entire page is a form, so each of the images must submit the same form,
but with a unique value for "addToCollection".

When the button is clicked, only "addToCollection.x" and
"addToCollection.y" come through as request parameters. 

Is there a way to access the value? 

Or do I have to go with javascript or something else?

TIA.



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>