cancel
Showing results for 
Search instead for 
Did you mean: 

'Sample custom action' for datalists

efvrvo
Champ on-the-rise
Champ on-the-rise
I have downloaded the "Sample custom action" zip file from the share extras website. I have successfully followed the instructions and constructed a few custom actions for our doc library.
I attempted to use this method to create a custom action for a datalist but It is not working. I have added the the icon to the datagrid but when I press the button it is not calling my javascript. It also does not show my custom icon as per my css file.

Could anyone please give me some pointers on what I need to change to the Sample custom action before compiling it to a jar file to make it work on datalist.
11 REPLIES 11

wabson
Star Contributor
Star Contributor
That's great to see. So your custom action is working, but it's not able to call the repo-tier web script to execute the script. Since that web script came from the Doclib-based Sample Script Action project (rather than the Data List Action project), the URL of that web script will refer to the doclib, not to the datalists. Hence the script is not found.

Try updating the web script URL in sample-script.post.desc.xml to be more in line with what you see being called in the log entry you posted, and it should work.

Cheers,
Will

efvrvo
Champ on-the-rise
Champ on-the-rise
Great thanks did as you said and now it works. Thank you very much
sample-script.post.desc.xml
<webscript>
  <shortname>Sample Script Action</shortname>
  <description>Document List Action - Execute a specific script against document(s)</description>
  <url>/slingshot/datalists/action/sample-script/node/{store_type}/{store_id}/{id}</url>
  <format default="json">argument</format>
  <authentication>user</authentication>
  <transaction>required</transaction>
</webscript>