Not able to refrence managed bean

Hi,

I’m trying to use a managed Bean of “test.view” in the “test2.view”. I tried of creating a reference of that managed bean and selected the “test2.view”. I see the structure of the managed bean also in the Test2.view. But when i modify the value ( property in the Managed bean) in the UI of test.view. I don’t see the modified values in the test2.view ?

Can you please let me know, how to get the values entered ( thro UI ) in one view, to other view ?

Is wiring topic linked with this ? (hav no knowledge on wiring )

Thank you,
Naidu

Hi Naidu,

What you are doing is correct, no need of wiring here.
Just check what is the scope of the Managed bean. You have to select ‘session’ while creating the managed bean as scope.

Hope it helps

Regards,
Sunil Kumar N

Hi Sunil,

Thank you for your reply… I tried with scope as Session, and also with Application.

In both cases - I’m able to see the managed bean in the bindings panel of the Second view. But only thing is when i change the value of the property in the Managed from the First view’s UI , I don’t see the changed value reflected in the Second View.

Please help me how to achieve this.

Thank you,
Naidu

Hi Naidu,

Try to print the values on the console while navigating from first view to second view. And also print the values of bean in the initilize method of second view. we will be able to see whether values are passing to second view.

Regards,
Sunil Kumar N

Sunil… I’m not navigating through the pages, as i’m seeing these portlets in a single portal. Let me know - Getting the values of the property in the referenced manged bean , is only possible thro’ Navigation ?

if yes, I’m not using any navigation.

I type a value in the input box. I binded this value to the property in the managed bean. Now in the second view i want to see the entered value as output. A very basic process i’m doing.

But i’m not getting that value. If thats so easy can you plz tell me the steps of doing.

Thankful to you… .

  • Naidu

Hi Naidu,

I am not getting what exactly you are trying do.
Please let me know how you are using the first and second view in a portlet.

If i am not wrong you are trying to enter a value in Input box and binding it a managed bean. In the second view you are binding the managed bean to the output.

Regards,
Sunil Kumar N
09731004527

Ya exactly Sunil. I’m trying the same. Binding the input of one page to the output of the other page. In the webMethods portal( i.e proj. ) we can see all the portlets, so in the portal view I’m seeing both the views. I want to see the value entered in one view to be displayed in the second view.

And also i would like to ask is there some option like “synchronize” control in the pallete to be used across diff. views. ? ?

I"m sorry, as I’m still in the A,B,C of learning CAF, so be my questions - Basic.

  • naidu

Hi Naidu,

Synchronize values can be used with in the view only.
Can you send me the package which you are doing now??

P.S: Dont be sorry, i am also at A,B,C’s only :slight_smile:

Regards,
Sunil Kumar N

Hi,
if I understood correctly, you have two different portlets in a page, and you want to have one portlet “pass” the value to the second one.
That will not work over a managed bean reference, since each portlet in a page has its own “portlet” session (this is a small difference with a web application). One way to do it would be over wiring (already mentioned before). Another one would be using External Portlet Links, passing the value to the appropriate preference with method “refresh”, but I don’t have my Designer open right now, so I am not 100% about this), and you would have to trigger/click somehow the “link”.

hope this helps,
Javier

Hi,
i’m new in software AG and i’m trying to pass information from one portlet to another in a portlet application project.
I’m using Extended Portlet URL using as Base URL the alias of my target portlet.
I wont to specify and a target action to call when the link is clicked, but i’m getting an error : the target action is not valid.
Can anybody tell me how can i do to resolve this error ?

Regards

Please review the “webMethods CAF Development Help > User Interface Controls Reference > Portlet Controls > Mitigate Portlet Security Vulnerabilities” of the Designer help.

Generally, the target method that you want to invoke would have to have the @PortletAction annotation on it and then you would just specify the method name as the target action when building your link:

For example:

@PortletAction  
public String doSayHello() {  
        error(FacesMessage.SEVERITY_INFO, "Hello, the 'doSayHello' portlet action was executed", null);  
       return OUTCOME_OK;  
}

Hi Eric,

i’m building the url like this :



                IPortletURL refreshUrl;
		try {
			refreshUrl = createActionUrl();
			
			refreshUrl.clearParameters();
			refreshUrl.clearState();
			refreshUrl.setBaseURL("myPortlet");
			refreshUrl.setTargetAction("myAction");

			log("URL : " + refreshUrl.toString());
			getFacesContext().getExternalContext().redirect(refreshUrl.toString());
			
		} catch (Exception e) {
			log("Exception creating Url : " + e.getMessage());
		}

where myPortlet is the alias of my target portlet and myAction is the action that i am trying to call.

My target action method is :


@PortletAction
	public void myAction(){
		log("******************  myAction()  say hello *******************************");
	}

i modified the portlet.xml configuration init_params indicating ANNOTATED_PORTLET_ACTIONS = true for both source and target portlets but i’m geting the following error :


Exception creating Url : [POP.007.0060]  The sendRedirect method can not be invoked after any of the following methods of the ActionResponse interface has been called: setPortletMode, setWindowState, setRenderParameter, setRenderParameters

Can you provide any more information about where the first block is running? If that is running in the middle of rendering the portlet, then you won’t be able to do a server-side redirect since part of the page has possibly already been sent to the client browser.

Also, what version of MWS are you using?

Hi Eric
i am using MMS 8.2 but finally i understood the problem, i was running the first block on the actionlistener and that’s absolutely wrong.
I moved the execution of the first block on the action method of the command button and it’s working.
thank’s for your help.

Regards

Fiorald