Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D19F0979B for ; Fri, 20 Jul 2012 18:42:52 +0000 (UTC) Received: (qmail 59578 invoked by uid 500); 20 Jul 2012 18:42:51 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 59551 invoked by uid 500); 20 Jul 2012 18:42:51 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 59538 invoked by uid 99); 20 Jul 2012 18:42:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 18:42:51 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.250.139 is neither permitted nor denied by domain of rochette.jonathan@gmail.com) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2012 18:42:46 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1SsI9h-0001ZI-Ew for users@wicket.apache.org; Fri, 20 Jul 2012 11:42:25 -0700 Date: Fri, 20 Jul 2012 11:42:25 -0700 (PDT) From: jrochette To: users@wicket.apache.org Message-ID: <1342809745420-4650664.post@n4.nabble.com> Subject: Updating content of AjaxFallbackDefaultDataTable when submitting a form with AjaxButton - wicket 6.0.0-beta2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi I want to change the content of a ajaxFallbackDefaultDataTable depending on the content of a form (think of it as a searchbar functionality). I used to do that in wicket 1.5.x but i can not seem to make it work in wicket 6.0.0-beta2. Any help would be greatly appreciated. Here is what my code look like : The dataTable : public SubscriberPage(PageParameters parameters) { super(parameters); add(new SearchForm("searchForm")); List> columns = new ArrayList>(); columns.add(new PropertyColumn(new Model("Telephone Number"), "tn", "tn")); [...] columns.add(new PropertyColumn(new Model("Initialized MB"), "initializedMB")); table = new AjaxFallbackDefaultDataTable("table", columns, subscriberDataProvider, 40); table.setOutputMarkupId(true); add(table); } and here is the form : private class SearchForm extends Form { private static final long serialVersionUID = 1L; private String tnModel; private Label tnLabel = new Label("tnLabel", "Telephone Number :"); private TextField tn; public SearchForm(String id) { super(id); tn = new TextField("tnTextField", new PropertyModel(this, "tnModel")); tn.setOutputMarkupId(true); add(tnLabel); add(tn); AjaxButton lSearchButton = new AjaxButton("searchButton") { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { SubscriberFilter filter = new SubscriberFilter(); target.add(table); if (!(tn.getValue() == null) && !tn.getValue().isEmpty()) { filter.setTn(tn.getValue()); } // giving the new filter to the dataProvider subscriberDataProvider.setFilterState(filter); } @Override protected void onError(AjaxRequestTarget target, Form form) { // TODO Implement onError(..) throw new UnsupportedOperationException("Not yet implemented."); } }; lSearchButton.setOutputMarkupId(true); this.setDefaultButton(lSearchButton); add(lSearchButton); } } Regards, Jonathan Rochette -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-content-of-AjaxFallbackDefaultDataTable-when-submitting-a-form-with-AjaxButton-wicket-6-0-02-tp4650664.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org