You still create the panel and add that to the AjaxFallbackDefaultDataTable .

                List<PromoType> subscriptions = 
Arrays.asList(PromoType.values());
                selectionsList.setObject(subscriptions);

                List<AbstractColumn> columns = new ArrayList<AbstractColumn>();
                columns.add(new PropertyColumn(new Model("id"),  "id"));
                columns.add(new PropertyColumn(new Model("alias"),  "alias"));
                columns
                                .add(new PropertyColumn(new Model("logins"),  
"logins"));

                columns.add(new PropertyColumn(new Model("email"),  "email"));

                columns.add(new AbstractColumn(new Model("userType")) {
                        public void populateItem(Item cellItem, String 
componentId,
                                        IModel model) {
                                Person person = (Person) model.getObject();

                                cellItem.add(new DropDownPanel(componentId, new 
PropertyModel(
                                                person, "userType"), 
Arrays.asList(UserType.values())));
                        }
                });

                ajaxTable = new AjaxFallbackDefaultDataTable(

                "ajaxTable", columns, new SortablePersonDataProvider(), 5);
                addMenu(ajaxTable);



2010/1/14 Johan Vogelzang <johan.vogelz...@gmail.com>:
> Thanks Ernesto, but i don't get it ...
> The only markup the AjaxFallbackDefaultDataTable needs is:
> ..
> <table class="horizontal" wicket:id="table">[table]</table>
> ..
> So I don't know how to apply your solution.
>
> Regards,
> Johan.
>
> 2010/1/14 Ernesto Reinaldo Barreiro <reier...@gmail.com>
>
>> You could create a panel containing the link and the label and add that
>> panel as the cell.... e.g. something like
>>
>> <html xmlns:wicket="org.apache.wicket">
>>    <body>
>>        <wicket:panel>
>>            <a wicket:id="link" title="" class="button">
>>                <span wicket:id="text">[text goes here]</span>
>>            </a>
>>        </wicket:panel>
>>    </body>
>> </html>
>>
>> Regards,
>>
>> Ernesto
>>
>> On Thu, Jan 14, 2010 at 2:38 PM, Johan Vogelzang
>> <johan.vogelz...@gmail.com>wrote:
>>
>> > Hi all,
>> >
>> > I am trying out the AjaxFallbackDefaultDataTable, but have trouble when I
>> > want to make a cell work as a link.
>> > With the code below the table displays the word [cell] in all the cells
>> of
>> > the first column (Name). When I click on the cell, the correct response
>> > page
>> > is opened. I tried to add a Label to the link but that results into a
>> > Wicket
>> > error.
>> > I red some posts about this issue, but I did not managed to find the
>> > correct
>> > solution.
>> >
>> > Who can help me?
>> >
>> > Regards,
>> > Johan.
>> >
>> > public class ComestiblesDataTablePage extends RBSTemplate {
>> >
>> >   �...@springbean(name = "breakfastService")
>> >    private BreakfastLocalService service;
>> >
>> >    private Integer maxItemsPerPage = 8;
>> >
>> >   �...@suppresswarnings("serial")
>> >    public ComestiblesDataTablePage() {
>> >
>> >        List<IColumn<ComestibleDto>> columns = new
>> > ArrayList<IColumn<ComestibleDto>>();
>> >
>> >        columns.add(new PropertyColumn<ComestibleDto>(new
>> > Model<String>("Name"), "name", "name") {
>> >           �...@override
>> >            public void populateItem(Item<ICellPopulator<ComestibleDto>>
>> > item, String componentId,
>> >                    IModel<ComestibleDto> rowModel) {
>> >
>> >                AjaxFallbackLink<ComestibleDto> link = new
>> > AjaxFallbackLink<ComestibleDto>(componentId, rowModel) {
>> >                   �...@override
>> >                    public void onClick(AjaxRequestTarget target) {
>> >                        setResponsePage(new ComestiblePage(getModel()));
>> >                    }
>> >                };
>> >                // link.add(new Label(componentId)); --> Error: component
>> > not markup, Component id = cell
>> >                item.add(link);
>> >            }
>> >        });
>> >        columns.add(new PropertyColumn<ComestibleDto>(new
>> > Model<String>("Minimal Quantity"), "minimalQuantity",
>> >                "minimalQuantity"));
>> >        columns.add(new PropertyColumn<ComestibleDto>(new
>> > Model<String>("Price"), "price", "price"));
>> >        columns.add(new PropertyColumn<ComestibleDto>(new
>> > Model<String>("TransportForm"), "transportForm"));
>> >
>> >        add(new AjaxFallbackDefaultDataTable<ComestibleDto>("table",
>> > columns, new ComestibleSortableDataProvider(
>> >                service), maxItemsPerPage));
>> >        add(new BookmarkablePageLink<Object>("edit",
>> > ComestiblesEditPage.class));
>> >    }
>> >
>> >   �...@override
>> >    public String getPageTitle() {
>> >        return getLocalizer().getString("lbl.comestibles", this);
>> >    }
>> >
>> > }
>> >
>>
>
>
>
> --
> Johan Vogelzang
>

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

Reply via email to