myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Schofield <sean.schofi...@gmail.com>
Subject Re: passing arguments to backed bean methods
Date Wed, 06 Apr 2005 14:15:44 GMT
What about having BeanB be a ValueChangeListener for BeanA?

sean


On Apr 6, 2005 10:06 AM, Heath Borders <heath.borders@gmail.com> wrote:
> Unfortunately, there is no way to pass arguments through the EL (well,
> actually there is a way to pass String arguments into Map getters, but that
> can lead to extreme hacking).  Your best bet is to pass an instance of Bean
> A to Bean B when Bean B is constructed (you can specify this in your
> faces-config.xml), and then utilize Bean A's value from inside Bean B's
> constructor.
> 
> 
>  
> On Apr 6, 2005 8:53 AM, Mihir Solanki <mihir.solanki@patni.com> wrote: 
> > 
> > 
> > 
> > Hi all, 
> > 
> >   
> > 
> > I  want to pass arguments to the backed bean method using JSF EL. 
> > 
> > Can anyone tell me how can I do this? 
> > 
> >   
> > 
> > Basically I have two list boxes in my page. 
> > 
> >   
> > 
> > List Box: A 
> > 
> > List Box: B 
> > 
> >   
> > 
> > There are two managed beans I have configured in my faces context fie. 
> > 
> >   
> > 
> > Bean: A 
> > 
> > Bean: B 
> > 
> >   
> > 
> > Now List Box A is being filled by one of the method of Bean A (this method
> does not have any argument). 
> > 
> > Now upon the change action on List Box A I have to fill up the List Box B
> (as per the selected value of A). 
> > 
> > I have created one method in Bean B which is taking an argument (basically
> it would be selected value of List Box A). 
> > 
> >   
> > 
> > So how can I pass selected value of List Box A to the method of Bean B? 
> > 
> >   
> > 
> > Both the beans have scope equals to session. 
> > 
> >   
> > 
> > Below is my JSF file looks like… 
> > 
> >   
> > 
> > <h:form id="selectForm"> 
> > 
> > <h:selectOneListbox id="selectA" value="#{BeanA.ID}"
> onchange="document.forms['selectForm'].submit() ;"> 
> > 
> > <f:selectItems value="#{BeanA.listA}" /> 
> > 
> > </h:selectOneListbox> 
> > 
> >   
> > 
> > <h:selectOneListbox id="selectB" value="#{BeanB.ID}"> 
> > 
> > <f:selectItems value="#{BeanB.listB….????????}" /> 
> > 
> > </h:selectOneListbox> 
> > 
> > </h:form> 
> > 
> >   
> > 
> > Regards, 
> > 
> > Mihir 
> > ________________________________
>  
> > 
> > 
> > Patni Computer Systems Ltd. 
> > 
> > 
> > Tel : 91 79 23240905 Ext : 413 
> > 
> >  
> > http://www.patni.com
> > World-Wide Partnerships. World-Class Solutions. 
> >
> _____________________________________________________________________
> > 
> > This e-mail message may contain proprietary, confidential or legally
> privileged information for the sole use of the person or entity to whom this
> message was originally addressed. Any review, e-transmission dissemination
> or other use of or taking of any action in reliance upon this information by
> persons or entities other than the intended recipient is prohibited. If you
> have received this e-mail in error kindly delete this e-mail from your
> records. If it appears that this mail has been forwarded to you without
> proper authority, please notify us immediately at netadmin@patni.com and
> delete this mail. 
> >
> _____________________________________________________________________
> 
> 
> 
> -- 
> -Heath Borders-Wing
> hborders@mail.win.org

Mime
View raw message