On 7/11/07, nazeem <[EMAIL PROTECTED]> wrote:


I have the same case where I wanted to customize the navigation toolbar to
add few action menu items as well. So I have written my own version of
AjaxFallbackCustomDataTable by just copying the
AjaxFallbackDefaultDataTable
code in to my package and renaming. There I have commented all addition of
toolbars and I am adding them at the time of declaring it.


public AjaxFallbackCustomDataTable(String id, final IColumn[] columns,
                        SortableDataProvider dataProvider, int
rowsPerPage)
        {
                super(id, columns, dataProvider, rowsPerPage);
                setOutputMarkupId(true);
                setVersioned(false);
                //addTopToolbar(new AjaxNavigationToolbar(this));
                //addTopToolbar(new AjaxCustomNavigationToolbar(this));
                //addTopToolbar(new AjaxFallbackHeadersToolbar(this,
dataProvider));
                addBottomToolbar(new NoRecordsToolbar(this));
        }

During declaration,

AjaxFallbackCustomDataTable table = new
AjaxFallbackCustomDataTable("employeesAjax", columns, dataProvider, 7);
AbstractToolbar navigationTB = new AjaxCustomNavigationToolbar(table);
navigationTB.add(new Label("newSpan"));
table.addTopToolbar(navigationTB);
table.addTopToolbar(new AjaxFallbackHeadersToolbar(table, dataProvider));
AjaxPagingNavigator pgNav = new AjaxPagingNavigator("paging", table);
add(table);

From the above code, it is clear that I have customized the
AjaxDefaultNavigationToolbar to AjaxCustomNavigationToolbar. The markup
html
is also copied and renamed to the same..html. So the problem here is that
I
am trying to add some action menus to the navigation toolbar, at
declaration, but it doesn't work.
navigationTB.add(new Label("newSpan"));

I have also modified the markup to contain wicket:id="newSpan".

<wicket:panel>
        <tr class="navigation">
                <td wicket:id="span">
                        <div class="actionmenu" style="float: left; width:
50%;">
                                &lt;span
wicket:id="newSpan"&gt;&lt;/span&gt;
                                 New &nbsp;&nbsp;
                                 # Save &nbsp;&nbsp;
                                 # Delete &nbsp;&nbsp;&nbsp;&nbsp;
                                Filter&nbsp;<input type="text"
style=""/>&nbsp;&nbsp;
                                 resr/table/img/find.png
                        </div>
                        <div style="float: left; padding-right:
20px;">[navigator-label]</div>
                        <div style="text-align: right;">[navigator]</div>
                </td>
        </tr>
</wicket:panel>


But I am getting the error that

[2007-07-12 10:24:11,453] [ERROR] [btpool0-2]
[wicket.RequestCycle.step(1043)] - Unable to find component with id
'newSpan' in [MarkupContainer [Component id = thirdPartyDetails, page =
[...]



if you look at your markup your newspan is in toolbar.span.newspan not in
toolbar.newspan. so you need to create your own version of toolbar by adding
all the pieces yourself instead of trying to add them to the toolbar so you
have full control of composition.

-igor
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to