• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This issue got resolved using the following code.



Thanks for Help...
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic