struts - ajax -js
0 posts in topic
Thread View Thread View

struts - ajax -js...
Mon Jul 02, 2012 02:54 AM

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 : ' " + { .

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 that' s ok too.
My objective is change asynchronously a single field of an entire jsp, reading the istantaneus value of <s:select > tag.   In struts2

Thanks Nicola
About | Sitemap | Contact