0

I am already stock.. I had created an extra button for struts2 jQuery Grid.. When I click the button, It should go to my Action. How to do this on click? Here is parts of my code.

 navigatorExtraButtons="{
            seperator: { 
            title : 'seperator'  
            }, 
            hide : { 
            title : 'Show/Hide', 
            icon: 'ui-icon-wrench', 
            onclick: function(){ load('<s:url action="ProductInitialise"/>')  } //--> this doesn't work.
            },
            alert : { 
            title : 'Alert', 
            caption : 'Show Alert!', 
            onclick: function(){ alert('Grid Button clicked!') }
            }
            }"
Roman C
  • 49,761
  • 33
  • 66
  • 176
user1917456
  • 15
  • 1
  • 7

1 Answers1

0

navigatorExtraButtons is a parameter of the <sjg:grid /> Struts2(-jQuery Plugin) tag.

You can't put a Struts2 tag inside another Struts2 tag;

to do that, you must use OGNL, and in the case of URLs you should define the URLs outside the grid tag, and refer to them with OGNL, like that:

<s:url id="myUrl" action="ProductInitialise" namespace="/myNamespace"/>

....

onclick: function(){ load('%{myUrl}') } 

Assuming all the rest is working (the load function for example), this should be enough to make it works.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • Hi @Andrea Ligios Thank you very much. the function load did not work... however I had found another function." window.location = '%{myUrl}' ". This is now okay. :) Thank you for the help. – user1917456 Jan 21 '13 at 21:07