cancel
Showing results for 
Search instead for 
Did you mean: 

Wizard - browseBean.getDocument returns null...

csiege
Champ in-the-making
Champ in-the-making
Hi,

I am developing a wizard similar in functionality to the invite content users wizard, but I am following the guidelines in the wiki.

I have it somewhat working with a problem I can't get past.   I have added the action to following section… so it shows in the additional actions menu.

<action-group id="document_browse_menu">

In the bean managing the wizard when I check the
this.browseBean.getDocument();

the return value is null!  EXCEPT if I first view the details of that document then go back and choose that action on the menu.

I am not getting the right instance for the context I need or I am
not using the right bean to get the document that I am "working" with.

What am I missing?

thanks.

Chris
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
As you've guessed, you need to setup some context for your wizard. The best way to do this is using an actionListener on the action definition that launches your wizard, so something like this:


<action-listener>#{BrowseBean.setupContentAction}</action-listener>
<params>
   <param name="id">#{actionContext.id}</param>
</params>

This config assumes that your action is within a data row that has an "id" column available (that should already be correct as your action is part of the document_browse_menu group).

the return value is null! EXCEPT if I first view the details of that document then go back and choose that action on the menu.
This is because the Details page uses exactly the code you see above to setup the Node context for the action page.

Hope this helps,

Kevin

csiege
Champ in-the-making
Champ in-the-making
It worked! Perfect!

Thanks for the quick reponse. 🙂

Chris