0

I make an Aikau page, and I open this page through a custom action document library. I give the nodeRef through the query of the Aikau page.

In the javascript code of the webscript in Share, I tried args["nodeRef"] and page.url.args["nodeRef"], but I can't get the nodeRef; all of them are null.

Can anyone help me get args of the link or nodeRef of the document of the action?

Mario Cervera
  • 671
  • 1
  • 8
  • 19
PRVS
  • 1,612
  • 4
  • 38
  • 75

1 Answers1

5

You should be using url.args['nodeRef'] instead of page.url.args['nodeRef']!

You are probably making this call from the JS controller of some webscript that is getting loaded in some region (may even cover the whole page) in some Spring Surf page ! Note that page.url.args['nodeRef'] is only available in the JS controller of webscripts serving as page template and is not available in other webscripts loaded in some region of a Spring Surf page in which case you should be using url.args['nodeRef']!

Note that in some other cases when you are invoking a webscript directly from service URI (without having any specific Spring Surf page handling the request), you may fetch get parameters as follow: args['nodeRef']

Younes Regaieg
  • 4,156
  • 2
  • 21
  • 37
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/11703178) – Yazan Mar 20 '16 at 14:29
  • @Yazan this provides the answer to my question! He solves my problem! Thanks Younes :D – PRVS Mar 20 '16 at 14:31
  • @PRVS i got this while review posts already reported, and still think this is not an answer, though it fixed your issue, but it's not a standard answer, ex, `try` using ... this is more of a comment – Yazan Mar 20 '16 at 14:33
  • My question is I use X and Y, this not works. Younes said: Try Z intead of X. This is an answer to my question, simple, clear and correct! – PRVS Mar 20 '16 at 14:34
  • i did my part of the work, let the community decides, whatever it is i am ok with it :) – Yazan Mar 20 '16 at 14:40
  • 2
    @Yazan: Thanks for pointing that out, I just improved the quality of anwser by adding some further details ! – Younes Regaieg Mar 20 '16 at 20:58