Re: best strategy to add toolbar
hhhmmm .. as simple as that :) On Wed, Apr 16, 2008 at 10:13 AM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > afaik toolbars are panels, so just override isvisible() on the toolbar > > -igor > > > On Tue, Apr 15, 2008 at 10:52 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a toolbar that I want to add to my table as bottom-toolbar ONLY > IF > > there are records (data-provider size >0). > > Here's where I put it: > > > > ... > > NumRecordsToolbar numRecordsToolbar = new NumRecordsToolbar(this); > > ... > > > > @Override > > protected void onBeforeRender() { > > if (dataProvider.size() > 0) { > > addBottomToolbar(numRecordsToolbar); > > } > > super.onBeforeRender(); > > } > > > > I know this is wrong as when the second time I render the page / table, > I > > get an exception. > > I can use a boolean to mark that I already put this toolbar but it > smells > > wrong to me... > > > > Is there a "best practice" for that? Another method I should try? > > (BTW, I tried it in onComponenetTag and of course it didn't work). > > > > > > Thanks > > > > -- > > Eyal Golan > > [EMAIL PROTECTED] > > > > Visit: http://jvdrums.sourceforge.net/ > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: best strategy to add toolbar
afaik toolbars are panels, so just override isvisible() on the toolbar -igor On Tue, Apr 15, 2008 at 10:52 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > Hi, > I have a toolbar that I want to add to my table as bottom-toolbar ONLY IF > there are records (data-provider size >0). > Here's where I put it: > > ... > NumRecordsToolbar numRecordsToolbar = new NumRecordsToolbar(this); > ... > > @Override > protected void onBeforeRender() { > if (dataProvider.size() > 0) { > addBottomToolbar(numRecordsToolbar); > } > super.onBeforeRender(); > } > > I know this is wrong as when the second time I render the page / table, I > get an exception. > I can use a boolean to mark that I already put this toolbar but it smells > wrong to me... > > Is there a "best practice" for that? Another method I should try? > (BTW, I tried it in onComponenetTag and of course it didn't work). > > > Thanks > > -- > Eyal Golan > [EMAIL PROTECTED] > > Visit: http://jvdrums.sourceforge.net/ > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
best strategy to add toolbar
Hi, I have a toolbar that I want to add to my table as bottom-toolbar ONLY IF there are records (data-provider size >0). Here's where I put it: ... NumRecordsToolbar numRecordsToolbar = new NumRecordsToolbar(this); ... @Override protected void onBeforeRender() { if (dataProvider.size() > 0) { addBottomToolbar(numRecordsToolbar); } super.onBeforeRender(); } I know this is wrong as when the second time I render the page / table, I get an exception. I can use a boolean to mark that I already put this toolbar but it smells wrong to me... Is there a "best practice" for that? Another method I should try? (BTW, I tried it in onComponenetTag and of course it didn't work). Thanks -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/