Re: How to call a method in the backing bean from a JSF page

2005-08-29 Thread Sean Schofield
Check out http://struts.apache.org/shale. The documentation is pretty complete and there are nightly build and examples you can download. sean On 8/26/05, Rick Reumann [EMAIL PROTECTED] wrote: I did it by just making the managedBean name the same as the jsp. So in your case: managed-bean

Re: How to call a method in the backing bean from a JSF page

2005-08-26 Thread Saul Qunming Yuan
This sounds like it may work for me. I never used Shale, so how do I map the backingbean from fooBar to fooBar.jsp as you mentioned below? in face-config.xml? thanks. On 8/24/05, Saul Qunming Yuan [EMAIL PROTECTED] wrote: Thanks for your response. I guess I didn't make me clear here. My

Re: How to call a method in the backing bean from a JSF page

2005-08-26 Thread Rick Reumann
I did it by just making the managedBean name the same as the jsp. So in your case: managed-bean managed-bean-namefooBar/managed-bean-name On 8/26/05, Saul Qunming Yuan [EMAIL PROTECTED] wrote: This sounds like it may work for me. I never used Shale, so how do I mapthe backingbean from fooBar to

Re: How to call a method in the backing bean from a JSF page

2005-08-25 Thread Ken Weiner
I am not sure if this is the best way, but one idea that could work is to create a PhaseListener that acts after the view is restored. In this phase listener, you could check if the view being restored is the view for which you want to call your backing bean method. Then, you could obtain a

Re: How to call a method in the backing bean from a JSF page

2005-08-25 Thread ssobot
but remember that getter may be called few times! i assume that in order to see your page user must click sth (ex. somme kind of menu) and i assume that u have action binded to that click that returs string maped to desired page. so just add call your method in that action. Słąwek Sobótka

Re: How to call a method in the backing bean from a JSF page

2005-08-25 Thread Volker Weber
Hi, i think you are looking for somthing like a PhaseListener. You can configure such a Listener in faces.xml. make your listener to return javax.faces.event.PhaseId.RENDER_RESPONSE in getPhaseId() method and the beforePhase() method of your listener is invoked just before rendering. Saul

Re: How to call a method in the backing bean from a JSF page

2005-08-25 Thread Rick Reumann
On 8/24/05, Saul Qunming Yuan [EMAIL PROTECTED] wrote: Thanks for your response. I guess I didn't make me clear here. My questionis how to call a method in the backing bean from a JSF page withoutrendering out anything to the screen. I would suggest using Shale with JSF. Use the Shale jars and

Re: How to call a method in the backing bean from a JSF page

2005-08-25 Thread Sean Schofield
I agree with Rick. Shale is what you want if you want to do something before rendering. In fact, there is a prerender method in the ViewControllr interface for just such an occassion. sean On 8/25/05, Rick Reumann [EMAIL PROTECTED] wrote: On 8/24/05, Saul Qunming Yuan [EMAIL PROTECTED] wrote:

How to call a method in the backing bean from a JSF page

2005-08-24 Thread Saul Qunming Yuan
Hi, I'm wondering what's the correct way to call a method in the backing bean from a JSF page.What I tried is to useh:outputText value="#{theBackingBean.theMethod}" /, the backing bean method returns an empty string, so nothing gets printed out in the page. Which works, but I am not sure

Re: How to call a method in the backing bean from a JSF page

2005-08-24 Thread Sean Schofield
The value attribute should be a *value* binding expression. It must bind to a *property*. So you do something like this ... value=#{theBackingBean.foo} and in your backing bean you have public String getFoo() { ... } public void setFoo(String fooValue) { ... } sean On 8/24/05, Saul

Re: How to call a method in the backing bean from a JSF page

2005-08-24 Thread Saul Qunming Yuan
Thanks for your reply, that makes sense. But won't h:commandLink render a link and h:commandButton render a button in the page? I don't want to display anything on the screen. My purpose is to initiate a call from the JSF page to a method in the backing bean when the JSF page loads. I'm

Re: How to call a method in the backing bean from a JSF page

2005-08-24 Thread Ken
Yes, commandLink and commandButton will render an anchor tag. If you don't want to do this you can do work in your properies getter method when it gets called by outputText value and return an empty string. However, I don't believe there is any guarante as to call order. Putting your target

Re: How to call a method in the backing bean from a JSF page

2005-08-24 Thread Saul Qunming Yuan
I see. The outputText way is actually what I did. So, is there a way to call a method in the backing bean when/before loading a JSF page? Something like a pre-render method before loading a JSF page? I can do that in the backing bean methods that forward to the JSF page, but there are many

Re: How to call a method in the backing bean from a JSF page

2005-08-24 Thread Saul Qunming Yuan
Thanks for your response. I guess I didn't make me clear here. My question is how to call a method in the backing bean from a JSF page without rendering out anything to the screen. - Original Message - From: Sean Schofield [EMAIL PROTECTED] To: MyFaces Discussion