Hello, Your solution is good, I actually did that, but it does not cover all the use cases.A toolbar can replace itself with another toolbar, but I need external access to the toolbars, from the hierarchy. For example, each table row has an 'edit' button, on click, I need the 'edit' toolbar to appear/activate.
My problem is that I can't reach the toolbar component with a simple table.get(DataTable.TOOLBAR_COMPONENT_ID) . I think I'll roll my own, as Igor suggested, Thank you very much! Alex On Sun, Nov 23, 2008 at 4:10 PM, James Carman <[EMAIL PROTECTED]>wrote: > How about you have your toolbar replace its own contents based on what > "mode" it's in? > > On Sun, Nov 23, 2008 at 7:59 AM, Alex Parvulescu > <[EMAIL PROTECTED]> wrote: > > Hi, > > Perhaps i did not make myself clear, > > > > After adding the toolbar , i need to replace it with another toolbar. > > > > Let's say that I have an 'add new' toolbar - with only an 'add new' > button, > > and an 'edit' toolbar, for the editing part. > > > > The user clicks 'add new' - the 'add new' toolbar is replaced with the > > 'edit' toolbar. on ok , the 'edit' toolbar is replaced again with the > 'add > > new' toolbar.A simple CRUD editor, embedded in the datatable component. > > > > That's why i need a way to reach the toolbar through the api, maybe > through > > the #get method (something like table.get(DataTable.TOOLBAR_COMPONENT_ID) > ) > > > > It seems that after adding a toolbar to a table, there is no way that you > > can reach it in the component hierarchy anymore. > > > > Thanks, > > Alex > > > > On Fri, Nov 21, 2008 at 5:49 PM, Igor Vaynberg <[EMAIL PROTECTED] > >wrote: > > > >> see #addbottomtoolbar() > >> > >> -igor > >> > >> On Fri, Nov 21, 2008 at 2:57 AM, Alex Parvulescu > >> <[EMAIL PROTECTED]> wrote: > >> > Hello, > >> > > >> > i have a question about the toolbars in the DataTable component. > >> > > >> > my use case is this : i want to embed a small editor in a bottom > >> toolbar.Its > >> > a simple ok / cancel panel. > >> > > >> > I see that there no access to the 'bottomToolbars' variable in the > >> DataTable > >> > its private and final and has no accessors. > >> > > >> > Plus theres no way i can replace a toolbar, if i try > >> > table.get(DataTable.TOOLBAR_COMPONENT_ID) the result is null, > >> > another approach is table.replace(new EditToolbar(table)); - which > >> outputs > >> > an error: org.apache.wicket.WicketRuntimeException: Cannot replace a > >> > component which has not been added: id='toolbar'... > >> > > >> > My guess is that this is because of the DataTable#addToolbar method: > >> > toolbar.setRenderBodyOnly(true); .. > >> > > >> > I have no workaround for this , except to drop the toolbars and start > new > >> > with some panels. > >> > > >> > My question is if theres a reason toolbars are hidden away from the > user, > >> > theres no clear way of working with them, except to initialise, and > them > >> let > >> > them be. > >> > > >> > > >> > btw i am using wicket 1.3.4 > >> > > >> > thanks, > >> > > >> > Alex > >> > > >> > >> --------------------------------------------------------------------- > >> 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] > >
