You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by cree <vi...@oswego.edu> on 2008/07/17 17:38:12 UTC

s:div Append Href

Hello All,

I am trying to use an s:div tag but need to update the href dynamically.  

To give an idea I have a <s:div listenTopic="/refresh" id="updateDiv"
href="testAction.action?" theme="ajax"/>.  I would like to on some user
event to either in javascript or any other way allow the href to append
specific variables.  I have tried to href="testAction?someVar=%{someVar}"
where someVar can be say a text field with the name someVar.  

That initially didnt work (not sure if I am missing something), but the next
attempt I did was to invoke a javascript function that would directly append
to the href of the div.  I read a bit and understand that the href is
stripped from the s:div tag, but I would like to at least append to it or
even use the variables that have been changed in the text field.  

Thanks in advance
-- 
View this message in context: http://www.nabble.com/s%3Adiv-Append-Href-tp18511393p18511393.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: s:div Append Href

Posted by cree <vi...@oswego.edu>.
So I was able to achieve what I wanted to by setting  separateScripts="false"
, I did read that somewhere but I was setting the separateScripts="false" in
the wrong div (using a div to load another div).  Now even after changing
the href to something completely different then publishing to the div to
refresh the href that has been changed is ignored and it reloads the page
that was initially set.

Am I using struts 2's div tags incorrectly, and or am I just not allowed to
do this with the div href tags.

Again thank you all for any input.



cree wrote:
> 
> Hello All,
> 
> I am trying to use an s:div tag but need to update the href dynamically.  
> 
> To give an idea I have a <s:div listenTopic="/refresh" id="updateDiv"
> href="testAction.action?" theme="ajax"/>.  I would like to on some user
> event to either in javascript or any other way allow the href to append
> specific variables.  I have tried to href="testAction?someVar=%{someVar}"
> where someVar can be say a text field with the name someVar.  
> 
> That initially didnt work (not sure if I am missing something), but the
> next attempt I did was to invoke a javascript function that would directly
> append to the href of the div.  I read a bit and understand that the href
> is stripped from the s:div tag, but I would like to at least append to it
> or even use the variables that have been changed in the text field.  
> 
> Thanks in advance
> 

-- 
View this message in context: http://www.nabble.com/s%3Adiv-Append-Href-tp18511393p18512818.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: s:div Append Href

Posted by cree <vi...@oswego.edu>.
That's exactly what I am looking for thank you very much!  You hit it right
on the nail.


Musachy Barroso wrote:
> 
> what you are looking for is the "formId" attribute. You can specify
> the id of a form, and the fields of the form will be submitted when
> the request is made. Check showcase for examples.
> 
> musachy
> 
> On Thu, Jul 17, 2008 at 11:38 AM, cree <vi...@oswego.edu> wrote:
>>
>> Hello All,
>>
>> I am trying to use an s:div tag but need to update the href dynamically.
>>
>> To give an idea I have a <s:div listenTopic="/refresh" id="updateDiv"
>> href="testAction.action?" theme="ajax"/>.  I would like to on some user
>> event to either in javascript or any other way allow the href to append
>> specific variables.  I have tried to href="testAction?someVar=%{someVar}"
>> where someVar can be say a text field with the name someVar.
>>
>> That initially didnt work (not sure if I am missing something), but the
>> next
>> attempt I did was to invoke a javascript function that would directly
>> append
>> to the href of the div.  I read a bit and understand that the href is
>> stripped from the s:div tag, but I would like to at least append to it or
>> even use the variables that have been changed in the text field.
>>
>> Thanks in advance
>> --
>> View this message in context:
>> http://www.nabble.com/s%3Adiv-Append-Href-tp18511393p18511393.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/s%3Adiv-Append-Href-tp18511393p18513802.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: s:div Append Href

Posted by Musachy Barroso <mu...@gmail.com>.
what you are looking for is the "formId" attribute. You can specify
the id of a form, and the fields of the form will be submitted when
the request is made. Check showcase for examples.

musachy

On Thu, Jul 17, 2008 at 11:38 AM, cree <vi...@oswego.edu> wrote:
>
> Hello All,
>
> I am trying to use an s:div tag but need to update the href dynamically.
>
> To give an idea I have a <s:div listenTopic="/refresh" id="updateDiv"
> href="testAction.action?" theme="ajax"/>.  I would like to on some user
> event to either in javascript or any other way allow the href to append
> specific variables.  I have tried to href="testAction?someVar=%{someVar}"
> where someVar can be say a text field with the name someVar.
>
> That initially didnt work (not sure if I am missing something), but the next
> attempt I did was to invoke a javascript function that would directly append
> to the href of the div.  I read a bit and understand that the href is
> stripped from the s:div tag, but I would like to at least append to it or
> even use the variables that have been changed in the text field.
>
> Thanks in advance
> --
> View this message in context: http://www.nabble.com/s%3Adiv-Append-Href-tp18511393p18511393.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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