• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts2Jquery <sj:submit>

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have below queries.

1. How can I create a cancel/reset button using Struts2Jquery plugin?
2. If I use <sj:submit> then below html is getting generated.



If I create any element after <sj:submit> then it is getting displayed under submit button. I want it to be displayed just adjacent to submit button. Which is the best place/approach to modify this default behavior?

Please advice.

Rgds
Peter
 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) I dont think there is a cancel/reset tag with the jquery plugin. I think you have to create it yourself
2) You probably need to change your theme to simple and you will need to handle the creation of the div tags and styles ... from the code you posted it looks like you have the xhtml theme on which is the default

 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for the suggestion.

1. I try to use struts reset button.

2. "handle the creation of the div tags and styles". Please provide some more details how to handle div tags.

I see many ftl files in simple theme. I am not sure which files I need to modify.

When I change my theme to simple I cannot see any labels which are visible in xhtml theme .


Rgds
Peter
 
Jesus Mireles
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You dont see the labels because like I said you have to handle the div and styles yourself. All I'm saying is that you need to write the HTML yourself if you use simple theme. However you get to more easily IMO control the look and feel of how the html gets rendered. On the other hand I think (im not 100% sure) that you can specify simple theme on a tag by tag basis which will let you put a reset button next to your submit button.
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried to apply theme to each input in the form.

I found a theme option for <s:textfield> but could not find the same for <sj:select> and <sj:submit>.

Both are having attribute template directory and template. So I modified them as below.



then i got error

I created subfolder under KUTheme and placed select.ftl in that. Still same error.

I am not sure what should be the correct file and folder for template and teplateDir. and also what file should be pointed to template attribute.

Please advice.

Rgds
Peter
 
Jesus Mireles
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I looked at the supported attributes and it doesnt have theme attribute. So just download the source and modify it or stop using this plugin ... Maybe submit a request to update it to support theme ... If I was in your shoes I'd be using simple theme throught the application so I'd put that in the struts.xml. If whatever you are trying to do wasnt solved by doing that then I'd modify the plugin code/compile and deploy my own version ....

-LM
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can simple create your own theme which includes the jquery freemarker templates.
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for reply. I will follow your advice.


Rgds
Peter
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic