Reports themselves are static (around 100 of them), this page should just 
display a combo with the reports name in a particular report category (chosen 
previously via a javascript drop-down menu) and then depending on the report 
chosen, resolve its parameters into dynamically generated controls. When a user 
clicks the submit button, then I pass all of these populated values to the 
jasperreport's template for the display.

Why is it not a good idea to create components in java code, could you 
elaborate?
We are not using facelets, just jsp's.  

Thanks.
Simeon


-----Original Message-----
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 08, 2006 2:04 PM
To: MyFaces Discussion
Subject: Re: Run-time component generation

How dynamic are these reports?  And how many are there?

What about creating page fragments for each one and including the one picked 
either with a jsp:include or a facelets ui:include?

If you really want to manually create components, the way to go about it is to 
bind a panelGrour to your page, and then manually set up everything with that 
binding getter.
You also MUST manually specific all required attributes (for example,
id) as part of this creation process.

However, I'd avoid creating components in java code if you can do so.
If it's just a matter of dynamically creating columns, use t:columns.

On 9/8/06, Leyzerzon, Simeon <[EMAIL PROTECTED]> wrote:
> Thanks, Mike.  I'm creating the components within the backing bean.  Here is 
> how:
>
> Jsp.~~~~~~~~~~~~~~~~~~
> <f:view>
>         <h:form id="selectorForm">
>         <h:panelGrid footerClass="subtitle" headerClass=""
>                                                         styleClass=""
>                                                         columnClasses=""
>                                                         
> binding="#{selector.panelGrid}">
>
>
>
> Backing bean~~~~~~~~~~~~~
>
>
> public HtmlPanelGrid getPanelGrid() {
>
>         grid = new HtmlPanelGrid();
>         grid.setColumns(4);
>         grid.setBgcolor("red");
>
>         HtmlSelectOneMenu chooser = new HtmlSelectOneMenu();
>         chooser.setId("reportsOfCategory");
>
>         chooser.setTitle("Please select a report to run");
>         
> chooser.getChildren().add(ReportsPerCategoryMapper.getOptionItems(this
> .getCategory().getName()));
>
>         grid.getChildren().add(chooser);
>
>         return grid;
>     }
>
>
> What I don't know is how to make the backing bean build the rest of the 
> components after chooser passes it the report selected.
>
> TIA.
> Simeon
>
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 08, 2006 12:38 PM
> To: MyFaces Discussion
> Subject: Re: Run-time component generation
>
> It's unclear what part you need help with.
>
> Start by looking at this page:
>
> http://wiki.apache.org/myfaces/SubmitPageOnValueChange
>
>
> On 9/8/06, Leyzerzon, Simeon <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Hi,
> >
> > I'm looking for some code samples to support the following use case:
> >
> >   I have a page with a form on which there's a combo-box (h:selectOneMenu).
> > The combo-box contains a list of available reports.  Depending on 
> > the user choice in the combo-box, I'd like to redisplay the same 
> > page with the combo-box with a dynamically generated list of 
> > components representing the user controls corresponding to the 
> > chosen report's parameters list to be passed to the server.  User 
> > then populates these controls with the parameter values and submits the 
> > form by clicking the submit button.
> >
> > The part that interests me most is: how to redisplay the same page 
> > with these newly populated controls after the selectOneMenu event 
> > passed to the server.
> >
> > I could provide more details if needed.
> >
> > Appreciate any help!
> >
> > Thank you,
> > Simeon Leyzerzon
> >
> > ====================================================================
> > == ======== Please access the attached hyperlink for an important 
> > electronic communications disclaimer:
> >
> > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > ====================================================================
> > ==
> > ========
> >
> >
> >
> >
>
> ======================================================================
> ======== Please access the attached hyperlink for an important 
> electronic communications disclaimer:
>
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ======================================================================
> ========
>
>

==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

Reply via email to