You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by James Carman <jc...@carmanconsulting.com> on 2009/07/14 16:51:26 UTC

Re: Problem with AjaxFallbackDefaultDataTable in 1.4-SNAPSHOT wicket-1.4-20090709.154646-550.jar [SEC=UNCLASSIFIED]

There's a built-in component for toggling check boxes in a check group.

On Mon, Jul 13, 2009 at 7:04 PM, <Mi...@health.gov.au> wrote:
> Hello.
>
> I'm attempting a simple AjaxFallbackDefaultDataTable with using
> 1.4-SNAPSHOT and the wicket-1.4-20090709.154646-550.jar and
> wicket-extensions-1.4-20090709.154646-542.jar files.
>
> I get the following error:
> WicketMessage: Unable to find component with id 'label' in
> [MarkupContainer [Component id = header]]. This means that you declared
> wicket:id=label in your markup, but that you either did not add the
> component to your page at all, or that the hierarchy does not match.
> [markup =
> jar:file:/D:/bin/geronimo-jetty6-javaee5-2.1.4/repository/au/gov/doha/DataTable/1.0-SNAPSHOT/DataTable-1.0-SNAPSHOT.war/WEB-INF/lib/wicket-extensions-1.4-SNAPSHOT.jar!/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.html
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one or more
>   contributor license agreements.  See the NOTICE file distributed with
>   this work for additional information regarding copyright ownership.
>   The ASF licenses this file to You under the Apache License, Version 2.0
>   (the "License"); you may not use this file except in compliance with
>   the License.  You may obtain a copy of the License at
>        http://www.apache.org/licenses/LICENSE-2.0
>   Unless required by applicable law or agreed to in writing, software
>   distributed under the License is distributed on an "AS IS" BASIS,
>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
>   See the License for the specific language governing permissions and
>   limitations under the License.
> -->
> <wicket:panel>
>                 <tr class="headers">
>                                 <span wicket:id="headers">
>                                                 <th
> wicket:id="header"><span wicket:id="label">[header-label]</span></th>
>                                 </span>
>                 </tr>
> </wicket:panel>, index = 6, current = '<span wicket:id="label">' (line 20,
> column 27)]
>
> The only change I've done from the example given at
> http://www.wicket-library.com/wicket-examples/repeater/ is a column:
>                checked = new
> AbstractColumn<CheckedApplicationProcessDetails>(new
> Model<String>("Select")) {
>                        @Override
>                        public void populateItem(
>  Item<ICellPopulator<CheckedApplicationProcessDetails>> cellItem,
>                                String componentId,
>                                IModel<CheckedApplicationProcessDetails>
> model)
>                        {
>                                cellItem.add(new
> CheckBoxPanel(componentId, model));
>                        }
>
>                        @Override
>                        public Component getHeader(String componentId) {
>                                // select option
>                                AjaxCheckBox checkBox = new
> AjaxCheckBox("SelectAll", new PropertyModel(this, "selectAll")) {
>                                        // checkbox provides 'check all'
> or 'check none' functionality
>                                        @Override
>                                        protected void
> onUpdate(AjaxRequestTarget target) {
> // how do we access the items within a datatable?
> //                                              Iterator iter =
> table.getItems();
> //                                              table.modelChanging();
> //                                              while(iter.hasNext()) {
> //
> ((CheckedApplicationProcessDetails)((Item)iter.next()).getModelObject()).setChecked(ListFundingTenders.this.selectAll);
> //                                              }
> //                                              table.modelChanged();
> //                                              checkBoxChanged();
>  target.addComponent(table);
>                                        }
>                                };
>                                return checkBox;
>                        }
>                };
>                columns.add(checked);
>
> Basically I want a column with a check box for each row, and a
> select-all/select-none checkbox for the header.   I fail to see how this
> could cause the error given above.
>
> Is the error message a bug in the snapshot?  Or am I somehow causing it?
>
> ______________________________________________________________________
> "Important: This transmission is intended only for the use of the addressee and may contain confidential or legally privileged information.  If you are not the intended recipient, you are notified that any use or dissemination of this communication is strictly prohibited.  If you receive this transmission in error please notify the author immediately and delete all copies of this transmission."
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org