Re: datatable and access to toolbars

2008-11-24 Thread Eyal Golan
Alex,
I think you can still use the DataTable provided by Wicket.
Why not make a toolbar as a member of the table, add it, and then you'll get
all the access you need?

Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Mon, Nov 24, 2008 at 9:31 AM, Alex Parvulescu
<[EMAIL PROTECTED]>wrote:

> 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]
> >
> >
>


Re: datatable and access to toolbars

2008-11-23 Thread Alex Parvulescu
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]
>
>


Re: datatable and access to toolbars

2008-11-23 Thread Igor Vaynberg
i dont know if we are going to add this to the api right now. we are
mostly concentrating on stabalizing 1.4 so we can get it out of the
door. maybe in 1.5...

you can always roll your own datatable. the class itself is pretty
small and delegates most of its work to datagridview. that way you can
write whatever code you want that manages toolbars.

-igor

On Sun, Nov 23, 2008 at 4: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]



Re: datatable and access to toolbars

2008-11-23 Thread James Carman
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]



Re: datatable and access to toolbars

2008-11-23 Thread Alex Parvulescu
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]
>
>


Re: datatable and access to toolbars

2008-11-21 Thread Eyal Golan
Hi Alex,
We had a similar situation.
We want a bottom toolbar that has a drop down for selection of number of
rows in a page.
After a while another requirement was added: add links that open a popup
window to change columns in the table and another one to open a popup for
filtering the table.
I wanted to add them both to the bottom toolbar.
As Igor said, we use addBottomToolbar.

Our table inherits from DataTable (not DefaultDataTable) because we changed
also the top toolbars.
Here's the code in the customized data table:
addBottomToolbar(new NoRecordsToolbar(this));
addBottomToolbar(new CustomizedBottomTableToolbar(this, rowsPerPage,
popupWindowsModel, showSelectRecordsPerPage));
The NoRecordToolbar is from Wicket.
CustomizedBottomToolbar inherits from AbstractToolbar.
Here's the HTML for the toolbar, the java code is normal with no special
features:


  [Link Text]  
  





Hope that helps.

Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


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]
>
>


Re: datatable and access to toolbars

2008-11-21 Thread Igor Vaynberg
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]



datatable and access to toolbars

2008-11-21 Thread Alex Parvulescu
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