Results 1 to 3 of 3
Thread: javascript inside tag Struts2
- 06-29-2012, 12:09 PM #1
Member
- Join Date
- Jun 2012
- Posts
- 3
- Rep Power
- 0
javascript inside tag Struts2
hello
Application with strut2
inside a jsp page I need dinamically change the value of textfield F1 <s:textfield> when a select field S1 select a new value.
I think for a javascript for the event S1 onmouseup who set F1 value.
The problem.
The value dependes by :
1) a property <s:property> P1, this is a file of an action so is in the ValueStack struts
2) the istantaneus value of S1 (value of select field) who is a javascript/dom readed value.
The property P1 is a MAP type so is necessary to use an index, this index is the variable javascript 'valueFieldS1'.
The problem is the need of parsing Javascript and Struts, I'm no able to resolve the value javascript inside tag Struts <s:property>
I have ried with many sintax modes : ' " + { .
nothing.
this is the code o javascript.
function setMyValue( valueField_Select1 ) {
document.getElementById('F1').value="<s:property value="P1['valoreCampoS1'].myProperty" />" ;
}
If you have other kind of solutions is ok.
My objective is change asynchronously a single field of an entire jsp, reading the istantaneus value of <s:select > tag.
with struts2
Thanks Nicola
ciao nicola
- 06-30-2012, 11:19 AM #2
Re: javascript inside tag Struts2
Why do they call it rush hour when nothing moves? - Robin Williams
- 07-02-2012, 11:00 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: javascript inside tag Struts2
I had to read this several times (and then have a weekend off), but you can't mix Struts tags (which are server side things) with Javascript values (which are client side things). At least that is what this looks like:
P1 does not exist on the server.Java Code:="<s:property value="P1['valoreCampoS1'].myProperty" />"
Please do not ask for code as refusal often offends.
Similar Threads
-
Struts2 java.lang.reflect.InvocationTargetException (Struts2 with Hibernate)
By sivakumar_sakam in forum Web FrameworksReplies: 0Last Post: 10-30-2011, 03:38 PM -
Getting text from inside a jeditorpane inside a jtabbedpane
By captain alge in forum New To JavaReplies: 9Last Post: 04-12-2011, 07:26 PM -
struts2 tag
By aaruviswa in forum Web FrameworksReplies: 1Last Post: 03-17-2011, 10:34 AM -
the check file inside of the zip in javascript
By naval gupta in forum Advanced JavaReplies: 1Last Post: 07-18-2009, 12:12 PM -
struts2
By catchme33 in forum Web FrameworksReplies: 4Last Post: 03-25-2009, 10:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks