On 8/23/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > Craig McClanahan wrote the following on 8/23/2005 3:27 PM: > > > Thus, the managed bean name corresponding to "/logon.jsp" *must* be > > named "logon" for it to be recognized as a ViewController. In your > > scenario, you left the name copied from the Use Cases example > > ("logon$profile"), which would be suitable for a page named > > "/logon/profile.jsp". > > Ok, this a total noob question, but it still has me confused. For > example you'll see the use of a DataTable.. > > <h:dataTable value="#{tableData.names}" var="name"> > ... > > this above would mean that I need a managed bean named "tableData" > configured. Ok I'm fine there.
Yes, you'd need that, but not because of Shale ... that's pure JSF level stuff. > > But now I see that you were a mentioning you need managed beans with > names that match a URL pattern? If so this is very confusing. Would you > then need to duplicate the managed bean definitions? > > For example (and this in relation to my question from yesterday), what > if if I had a forward (or even someone typing in the url directly) that > went to a page... > > employees.jsp > > and on that page, I needed to used a dataTable to show the list of > employees. I currently have a managed bean definiton: > > <managed-bean> > <managed-bean-name>employeeBacking</managed-bean-name> > <managed-bean-class>net.reumann.EmployeeBacking</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > > I then planned to use it on the employees.jsp with a dataTable: > > <h:dataTable value="#{employeeBacking.employees}" var="emp"> > > EmployeeBacking extends AbstractViewController > > and I have a prerender() in there that just throws in some sample data > into my employees List in the EmployeeBacking class. > > I'm too am having difficulty getting the prerender to fire:( > > Is the problem that at I need another managed-bean definition with the > name "employees" attached to the same "EmployeeBacking" object? > > TIA for any help. > The important principle is really pretty easy to articulate: IF you want your backing bean to implement ViewController and get its event methods called, THEN the name of the managed bean MUST conform to the mapping rules. That would mean, for a page named "/employee.jsp", then the managed bean name (if you use the default mapper, which is recommended) MUST be "employee", not "employeeBacking". Making that change would also mean changing expressions that use "employeeBacking" now to use "employee" instead, so you'd have: <h:dataTable value="#{employee.employees}" var="emp"> since you're changing the name of the managed bean. If you don't need your backing bean to implement ViewController, then Shale imposes no restrictions ... pure JSF code continues to work. But you would not get the extra event calling services in that case. Craig > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]