• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 - Need to change the value of style element of s:textfield dynamically using local variable

 
Mithil Shukla
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to change the value of style element "top" with the local variable vTopPosition.

Below is the code which is not working.


<%! int vTopPosition = 255; %>

<s:iterator var="characteristicValues" value="MaterialDTO.characteristicValue">

<s:textfield id="attribute" name="abc" value="%{characteristicValues}" type="text" cssClass="input" readonly="true"
style="position: absolute; width: 200px; left: 227px; top: <%=vTopPosition>px; z-index: 31" />

<% vTopPosition=vTopPosition+25;%>
</s:iterator>

Kindly suggest what changes I need to make to make top element dynamic.
 
Mithil Shukla
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How will JRebel will solve the my issue.
Guess I was very clear of what I want, I need to dynamically change the value of TOP attribute specified in the <s:textfield
I am using the struts2-tag.
 
jatan bhavsar
Ranch Hand
Posts: 297
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mithil,

for this you need to change the struts themes. Refer the struts documentation. Struts tags are there in struts2core.jar .

The theme templates (simple, xhtml, css_xhtml) can be found in the Struts 2 core jar file. If you expand (extract the files) the Struts 2 core jar file you'll find folders named template.css_xhtml, template.simple, and template.xhtml. Those folders contain the templates for the three default Struts 2 themes. In each folder is a file for each Struts 2 tag. For example if you expand the template.xhtml folder you’ll see the select.ftl file.



Refer this document: Document

Regards
jatan
 
Mithil Shukla
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This issue got resolved using the following code.



Thanks for Help...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic