cancel
Showing results for 
Search instead for 
Did you mean: 

action with parameter?

roman
Champ in-the-making
Champ in-the-making
hey folkz,

hope i can get an answer:

i need an entry in the menu more actions to start a wizard…
this is no problem. but i would like to have this action with parameters.
there will be more action entries in that which start the same wizard
but different functionality, depending on which parameter passed.

please tell me, what is it good for (the params tag)?:

<action id="custom_upload">
   <permissions>
      <permission allow="true">Write</permission>
   </permissions>
   <label-id>custom_upload</label-id>
   <image>/images/icons/upload_doc.gif</image>
   <action>wizard:myCustomWizard</action>
   <params>
      <param name="id">#{actionContext.id}</param>
   </params>
</action>

and what is this actionContext?
can i pass my own parameter like:
   <params>
      <param name="myparam">test</param>
   </params>

and where can i get them in the bean?
init(params)? i've tried it, but i receive params=null

please help

best regards
4 REPLIES 4

roman
Champ in-the-making
Champ in-the-making
I've checked it with firefox plugin tamper data.
on action execute the parameter
myparam with the value test is submitted (as a post parameter)
now how can i get access on this value from the bean?

best regards

roman
Champ in-the-making
Champ in-the-making
ok, I've got the params…
…but still don't know what
<param name="id">#{actionContext.id}</param>
is good for

gavinc
Champ in-the-making
Champ in-the-making
You can get access to the params specified within <params></params> in the init(params) method of your wizard or dialog bean.

To get them passed though you have to also add the following line to your action definition:

<action-listener>#{WizardManager.setupParameters}</action-listener>

The #{actionContext.id} parameter is only useful of you are performing some action against a node in the repository, this parameter in that case will hold the id of the node the action needs to execute against.

Hope that helps.

roman
Champ in-the-making
Champ in-the-making
many thanx,
i've solved it another way, but i'll keep this in mind.

best regards  Smiley Very Happy