You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Antonio muñoz alonso <an...@hotmail.com> on 2012/11/08 22:46:32 UTC

Updating datatable ajax

How could update a datatable?


DefaultDataTable datatable = createDataTable();

text.add(new AjaxFormComponentUpdatingBehavior("onchange")		        {
@Override		            protected void onUpdate(AjaxRequestTarget target)		            {
		              datatable.setOutputMarkupId(true);		              target.addComponent(datatable);		            			            			           		            }}I can not update datatable. 

 		 	   		  

Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
depending on what you specify in the text appear one row or other.

replaceWith,does not work



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4653742.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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
depending on what you specify in the text appear one row or other.

replaceWith,does not work



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4653743.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
Why do you want to recreated the dataTable?

Sven



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4653741.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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
modified but not update the datatable.
after selecting the text does not call the function createDataTable();

¿?




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4653736.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
The markupId has to be rendered before the actual Ajax request:

DefaultDataTable datatable = createDataTable();
datatable.setOutputMarkupId(true);

text.add(new AjaxFormComponentUpdatingBehavior("onchange") {
   @Override
   protected void onUpdate(AjaxRequestTarget target) {
     target.addComponent(datatable);
}}

Sven


On 11/08/2012 10:46 PM, Antonio muñoz alonso wrote:
> How could update a datatable?
>
>
> DefaultDataTable datatable = createDataTable();
>
> text.add(new AjaxFormComponentUpdatingBehavior("onchange")		        {
> @Override		            protected void onUpdate(AjaxRequestTarget target)		            {
> 		              datatable.setOutputMarkupId(true);		              target.addComponent(datatable);		            			            			           		            }}I can not update datatable.
>
>   		 	   		


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


Re: Updating datatable ajax

Posted by Paul Borș <pa...@bors.ws>.
I stand corrected as I missed one of your replies. I see now that you're using Ajax and you have a drop down of which value you would like to append an extra row to your table.

Yes, keep the list in memory if its small enough and add the enter in the correct place and the refresh the table via Ajax. As long as your data provider manipulates the same list it should work just fine.

If you want code examples let me know, I have plenty of those add new editable rows.

Have a great day,
Paul Bors

On Nov 24, 2012, at 1:03 AM, "Paul Borș" <pa...@bors.ws> wrote:

> Silly question, but do you refresh the table either via Ajax or a page refresh by sending a parameter of your data provider through a constructor or something?
> 
> Because simply manipulating the data provider will no magically redraw things on the screen :)
> 
> Put a log or break in your data provider and see it for your self.
> 
> Have a great day,
> Paul Bors
> 
> On Nov 20, 2012, at 6:21 PM, anton <an...@hotmail.com> wrote:
> 
>> help please !!!!
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654051.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
>> 

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


Re: Updating datatable ajax

Posted by Paul Borș <pa...@bors.ws>.
Silly question, but do you refresh the table either via Ajax or a page refresh by sending a parameter of your data provider through a constructor or something?

Because simply manipulating the data provider will no magically redraw things on the screen :)

Put a log or break in your data provider and see it for your self.

Have a great day,
Paul Bors

On Nov 20, 2012, at 6:21 PM, anton <an...@hotmail.com> wrote:

> help please !!!!
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654051.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
> 

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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
help please !!!!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654051.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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
I do not understand how you can be so hard to update a table



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654050.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
Please read here:

http://stackoverflow.com/questions/7935227/apache-wicket-datatable-filtering-with-filtertoolbar-vs-manual-filtering

Sven

On 11/20/2012 08:48 PM, anton wrote:
>       //UserProvider extends SortableDataProvider	
>
> final ISortableDataProvider<User> datatable = new
> UserProvider(tableValue()){
>
> 			private static final long serialVersionUID = 1L;
>
> 			@Override
>              public List<Contact> getList()
>              {
>                return tableValue(); //returns the values ​​for the selected
> options
>              }
>
>          };
> still does not update the table ¿?
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654046.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
>


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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
     //UserProvider extends SortableDataProvider	

final ISortableDataProvider<User> datatable = new
UserProvider(tableValue()){

			private static final long serialVersionUID = 1L;

			@Override
            public List<Contact> getList()
            {           
              return tableValue(); //returns the values ​​for the selected
options
            }

        };
still does not update the table ¿?




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654046.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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
therefore no idea.
I'll do without ajax




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654044.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
> table.setDefaultModelObject(new UsertProvider(ListUser())

The dataTable doesn't use its model object and you cannot change the dataProvider either.

You have to make your UserProvider dynamic:

   table = new DataTable(..., new IDataProvider<User>() {
     @Override
     protected List<User> getList() {
       // get users *matching the current filter input*
       // .. and sort it
     }
     ...
   });

Sven


On 11/20/2012 05:40 PM, anton wrote:
> There is a DropChoice.
> Depending on the selected item should appear the list of users.
>
> Automatic table should be generated with users,after this line
> target.addComponent(table); ¿?
>
> ContactProvider contactProvider = new ContactProvider(ListUser());
>    final AjaxFallbackDefaultDataTable<User> table =new
> AjaxFallbackDefaultDataTable<Usert>("table", columns, contactProvider, 10);
>          
> It does this either  --> table.setDefaultModelObject(new
> UsertProvider(ListUser()); or replaceWith.
>
> Any ideas?
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654041.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
>


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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
There is a DropChoice.
Depending on the selected item should appear the list of users.

Automatic table should be generated with users,after this line
target.addComponent(table); ¿?

ContactProvider contactProvider = new ContactProvider(ListUser());
  final AjaxFallbackDefaultDataTable<User> table =new
AjaxFallbackDefaultDataTable<Usert>("table", columns, contactProvider, 10);
        
It does this either  --> table.setDefaultModelObject(new
UsertProvider(ListUser()); or replaceWith.

Any ideas?




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654041.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
The interesting stuff is missing:
How do you pass the input of your textField into your provider to 
limit/filter the values?

Sven

On 11/20/2012 04:13 PM, anton wrote:
> UserProvider.java
>
> https://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654028.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
>


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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
UserProvider.java

https://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654028.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


Re: Updating datatable ajax

Posted by Sven Meier <sv...@meiers.net>.
Show us the relevant code from your DataProvider.

Sven


anton wrote
> I use a class extends of DataProvider.
> The problem is that not change the values ​​in the table, no updating. ¿?





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654027.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


Re: Updating datatable ajax

Posted by anton <an...@hotmail.com>.
I use a class extends of DataProvider.
The problem is that not change the values ​​in the table, no updating. ¿?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-datatable-ajax-tp4653734p4654026.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