Thanks for the prompt reply Jan.
So I should have the following in the JSP
file…
<h:form>/bigger>/color>/fontfamily>
/bigger>/fontfamily>
<h:inputText/color> id/color>="name01/color>"
value/color>="01" maxlength/color>="10"
size/color>="15" required/color>="true/color>"
/>/color>/bigger>/fontfamily>
/bigger>/fontfamily>
<h:inputText/color>
id/color>="name02/color>"
value/color>="02" maxlength/color>="10"
size/color>="15" required/color>="true/color>"
/>/color>/bigger>/fontfamily>
/bigger>/fontfamily>
<h:commandButton/color>
value/color>="Create" action/color>="#{taskMangerBean.saveBeans/color>}"/>/color>/bigger>/fontfamily>
</h:form>/bigger>/color>/fontfamily>
I’ve done this, but when the even is called the 2 beans contain null
values.
How does MyFaces/JSF know that name01/color>
belongs to the bean Bean01
& that name02 belongs to the
bean Bean02?
Thanks
Jeff.
-----Original Message-----
From: ir. ing. Jan Dockx
[mailto:[EMAIL PROTECTED]
Sent: 12 October 2005 16:55
To: MyFaces Discussion
Subject: Re: one button 2 forms...
how?
You
can't nest forms. Just remove the nested form definitions. You're done.
On 12 Oct 2005, at 17:42, Jeffrey Porter wrote:
/bigger>/fontfamily>Hello all,
/bigger>/fontfamily>
/bigger>/fontfamily>I’m a little stuck
& need some guidance.
/bigger>/fontfamily>
/bigger>/fontfamily>I have a web page
with 2 forms on it. (Bean01 & Bean02).
/bigger>/fontfamily>I want to be able
to have the user click a button and then behind the scenes take the data from
these 2 beans and persist it.
/bigger>/fontfamily>I’m not sure how to
do this & require someone pointing me in right direction.
/bigger>/fontfamily>
/bigger>/fontfamily>Example of what I’m
trying… (I know this wont work, I’d like to know what I should do)
/bigger>/fontfamily>
/bigger>/fontfamily><h:form>/bigger>/color>/fontfamily>
/bigger>/fontfamily>
<h:form/bigger>/color>
id/color>="form1/color>"
name/color>="formBean01/color>">/color>/bigger>/fontfamily>
<h:inputText/color>
id/color>="name01/color>"
value/color>="01" maxlength/color>="10"
size/color>="15" required/color>="true/color>"
/>/color>/bigger>/fontfamily>
</h:form>/color>/bigger>/fontfamily>
/bigger>/fontfamily>
<h:form/color>
id/color>="form2/color>"
name/color>="formBean02/color>">/color>/bigger>/fontfamily>
<h:inputText/color>
id/color>="name02/color>"
value/color>="02" maxlength/color>="10"
size/color>="15" required/color>="true/color>"
/>/color>/bigger>/fontfamily>
</h:form>/color>/bigger>/fontfamily>
/bigger>/fontfamily>
/bigger>/fontfamily>
<h:commandButton/color>
value/color>="Create" action/color>="#{taskMangerBean.saveBeans/color>}"/>/color>/bigger>/fontfamily>
</h:form>/bigger>/color>/fontfamily>
/bigger>/fontfamily>
/bigger>/fontfamily> public
String saveBeans() {
/bigger>/fontfamily>
FacesContext facesContext = FacesContext.getCurrentInstance();
/bigger>/fontfamily>
VariableResolver vr = facesContext.getApplication().getVariableResolver();
/bigger>/fontfamily>
/bigger>/fontfamily>
Bean01 bean01 = (Bean01) vr.resolveVariable(facesContext, "bean01");
/bigger>/fontfamily>
Bean02 bean02 = (Bean02) vr.resolveVariable(facesContext, "bean02");
/bigger>/fontfamily>
/bigger>/fontfamily>
//insert any bus logic here
/bigger>/fontfamily>
return ("sucesss");
/bigger>/fontfamily> }
/bigger>/fontfamily>
/bigger>/fontfamily>
/bigger>/fontfamily>
/bigger>/fontfamily>Thanks
/bigger>/fontfamily>Jeff
/bigger>/fontfamily>
Met
vriendelijke groeten,
Jan Dockx
/x-tad-smaller>PeopleWare NV -
Head Office
/x-tad-smaller>/color>Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66
/x-tad-smaller>/fontfamily>
/x-tad-bigger>/fontfamily>PeopleWare
NV - Branch Office Geel
/x-tad-smaller>/color>Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25
/x-tad-smaller>/fontfamily>
/x-tad-bigger>/fontfamily>http://www.peopleware.be/
/x-tad-smaller>http://www.mobileware.be//x-tad-smaller>/color>/fontfamily>