if you set the panel to be invisible on first render, you also have to call panel.setOutputMarkupPlaceholderTag(true) so that a "hidden" placeholder is rendered, which gets replaced with the real panel once you set it to visible and add it to the ajaxrequestarget.
Gerolf On Fri, Mar 21, 2008 at 10:54 AM, Stephan Koch <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a Page with a DropDown Component and a Panel. The Panel displays > some stuff based on the model object of the DropDown. > In the constructor of my page, I set panel.setVisible(false) to prevent > the panel from being rendered while the model object of the DropDown is > null because the user has not yet selected an option. > > Now I want the Panel to be rendered once a valid choice is selected by > the user. I tried this: > > protected void onEvent(AjaxRequestTarget target) { > log.debug("ddMonth onChange triggered."); > if(month != null) { > reportPanel.setVisible(true); > reportPanel.updatePanel(getServiceManager(), > getUser(), month); > target.addComponent(reportPanel); > } > } > > > The event is triggered, the panel is not rendered though. Is there a way > to achieve this without reloading the entire page? > If not, how would I trigger a page reload from the onEvent method? > > Thanks, > Stephan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >