Update ListView using ajaX

2009-12-05 Thread local_shamil

in case if you found the solution, can u plzz reply to the forum

freak182 wrote:
 
 Hello,
 
 For no apparent reason the listview is not updating when i targeted it. im
 using wicket 1.4.1.
 
 here is the code:
 
 final WebMarkupContainer resultcontainer = new
 WebMarkupContainer(resultcontainer);
 add(resultcontainer.setOutputMarkupId(true));
 
 final ListViewCustomFileDescription files = new
 ListViewCustomFileDescription(files, results)
 {
 @Override
 protected void populateItem(ListItemCustomFileDescription item)
 {
 final CustomFileDescription fileDesc = item.getModelObject();
 item.setModel(new
 CompoundPropertyModelCustomFileDescription(fileDesc));
 item.add(new Label(name));
 item.add(new Label(lastModified));
 }
 };
 //files.setReuseItems(true);
 resultcontainer.add(files);
 
 final ListCustomFileDescription results =
 fileSearchService.search(query.getDefaultModelObjectAsString());
 System.out.println(results.size());
 files.setDefaultModelObject(results);
 target.addComponent(resultcontainer);
 
 ...the results are just appending to each other.
 
 Thanks a lot.
 Cheers.
 
 

-- 
View this message in context: 
http://old.nabble.com/Update-ListView-using-ajax-tp25310457p26662446.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajaX

2009-12-05 Thread Don Ferguson

Hi all.

Rather than overwriting results, shouldn't the code be more like:

ListCustomFileDescription results = new  
ArrayListCustomFileDescription();
final WebMarkupContainer resultcontainer = new  
WebMarkupContainer(resultcontainer);

 add(resultcontainer.setOutputMarkupId(true));

 final ListViewCustomFileDescription files = new  
ListViewCustomFileDescription(files, results)

   {
  ...
   };
   resultcontainer.add(files);
...

  results.clear();
  results.addAll(Arrays.AsList(
fileSearchService.search(query.getDefaultModelObjectAsString()
  ));
  target.addComponent(resultcontainer);

When you create the ListView, pass an instantiated List object (the  
Model Object, essentially), and modify the model by adding stuff to it.


-Don

On Dec 5, 2009, at 9:42 PM, local_shamil wrote:



in case if you found the solution, can u plzz reply to the forum

freak182 wrote:


Hello,

For no apparent reason the listview is not updating when i targeted  
it. im

using wicket 1.4.1.

here is the code:

final WebMarkupContainer resultcontainer = new
WebMarkupContainer(resultcontainer);
   add(resultcontainer.setOutputMarkupId(true));

   final ListViewCustomFileDescription files = new
ListViewCustomFileDescription(files, results)
   {
   @Override
   protected void populateItem(ListItemCustomFileDescription  
item)

   {
   final CustomFileDescription fileDesc = item.getModelObject();
   item.setModel(new
CompoundPropertyModelCustomFileDescription(fileDesc));
   item.add(new Label(name));
   item.add(new Label(lastModified));
   }
   };
   //files.setReuseItems(true);
   resultcontainer.add(files);

final ListCustomFileDescription results =
fileSearchService.search(query.getDefaultModelObjectAsString());
   System.out.println(results.size());
   files.setDefaultModelObject(results);
   target.addComponent(resultcontainer);

...the results are just appending to each other.

Thanks a lot.
Cheers.




--
View this message in context: 
http://old.nabble.com/Update-ListView-using-ajax-tp25310457p26662446.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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




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



Re: Update ListView using ajax

2009-12-03 Thread Hui Chen

I met the same problem, how you adjust your markup?

And I found that if the listView is a  part of a table markup(as your code
above) and  when it's updated via Ajax by target.addComponent(container),
the original container in the page can not be replaced , a same new one will
show in the page.

That means in the table markup, if WebMarkupContainer of listView is the
table, everything will be Ok,
but if the WebMarkupContainer of listView is a div, things weird happened
.

Why it happens? browser?



freak182 wrote:
 
 Hello,
 
 thank you for your. i already make it work. (need to adjust some markup
 thing :) )
 
 thanks a lot.
 cheers.
 
 
 michael mosmann wrote:
 
 Hmm,..
 
 can you post your markup? this code does work with my own markup..
 
 did you use div wicket:id=resultcontainer or did you use
 wicket:container wicket:id=resultcontainer .. do you see something
 in wicket-ajax-debug panel? any error-message? any ajax-response?
 
 ...and im pretty sure that i already some code in previous version of
 wicket
 and it work..but i dont know what im missing right now. maybe worst case
 i
 will do is to go back to old version of wicket but i want the latest
 version.
 
 if this does not work with wicket 1.4.1, then it does not work with any
 wicket version.. 
 
 mm:)
 
 -- 
 Michael Mosmann - http://www.wicket-praxis.de/blog 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Update-ListView-using-ajax-tp25310457p26635790.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajax

2009-11-25 Thread Roger Armstrong

Which markup thing did you adjust to make it work?


freak182 wrote:
 
 i already make it work. (need to adjust some markup thing :) )
 

-- 
View this message in context: 
http://old.nabble.com/Update-ListView-using-ajax-tp25310457p26514074.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajax

2009-09-07 Thread Michael Mosmann
Hmm,..

can you post your markup? this code does work with my own markup..

did you use div wicket:id=resultcontainer or did you use
wicket:container wicket:id=resultcontainer .. do you see something
in wicket-ajax-debug panel? any error-message? any ajax-response?

 ...and im pretty sure that i already some code in previous version of wicket
 and it work..but i dont know what im missing right now. maybe worst case i
 will do is to go back to old version of wicket but i want the latest
 version.

if this does not work with wicket 1.4.1, then it does not work with any
wicket version.. 

mm:)

-- 
Michael Mosmann - http://www.wicket-praxis.de/blog 


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



Re: Update ListView using ajax

2009-09-07 Thread freak182

Hello,

my markup:

fieldset
legendList of Files/legend
table border=1
tr
tdDate Uploaded/td
tdName/td
/tr
div 
wicket:id=resultcontainer
tr wicket:id=files
td/td
td/td
/tr
/div
/table
/fieldset

...ajax response:

first result:

?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
id=resultcontainer4 ![CDATA[div id=resultcontainer4
tr
td9/6/09 12:05 AM/td
tdThe_tree_is_on_fire.jpg/td
/tr
/div]]/component/ajax-response

next time i hit the button:

?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
id=resultcontainer4 ![CDATA[div id=resultcontainer4
tr
td9/6/09 12:59 AM/td
tdDeath_Valley_IMG_1936.jpg/td
/tr
/div]]/component/ajax-response

...seems right...but in display in firefox:

http://www.nabble.com/file/p25326096/Screenshot-Mozilla%2BFirefox.png 

thanks a lot.
cheers.


michael mosmann wrote:
 
 Hmm,..
 
 can you post your markup? this code does work with my own markup..
 
 did you use div wicket:id=resultcontainer or did you use
 wicket:container wicket:id=resultcontainer .. do you see something
 in wicket-ajax-debug panel? any error-message? any ajax-response?
 
 ...and im pretty sure that i already some code in previous version of
 wicket
 and it work..but i dont know what im missing right now. maybe worst case
 i
 will do is to go back to old version of wicket but i want the latest
 version.
 
 if this does not work with wicket 1.4.1, then it does not work with any
 wicket version.. 
 
 mm:)
 
 -- 
 Michael Mosmann - http://www.wicket-praxis.de/blog 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Update-ListView-using-ajax-tp25310457p25326096.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajax

2009-09-07 Thread freak182

Hello,

thank you for your. i already make it work. (need to adjust some markup
thing :) )

thanks a lot.
cheers.


michael mosmann wrote:
 
 Hmm,..
 
 can you post your markup? this code does work with my own markup..
 
 did you use div wicket:id=resultcontainer or did you use
 wicket:container wicket:id=resultcontainer .. do you see something
 in wicket-ajax-debug panel? any error-message? any ajax-response?
 
 ...and im pretty sure that i already some code in previous version of
 wicket
 and it work..but i dont know what im missing right now. maybe worst case
 i
 will do is to go back to old version of wicket but i want the latest
 version.
 
 if this does not work with wicket 1.4.1, then it does not work with any
 wicket version.. 
 
 mm:)
 
 -- 
 Michael Mosmann - http://www.wicket-praxis.de/blog 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Update-ListView-using-ajax-tp25310457p25326735.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajax

2009-09-06 Thread Michael Mosmann
Am Sonntag, den 06.09.2009, 01:05 +0800 schrieb Eman Nollase:
 Hello,
 
 For no apparent reason the listview is not updating when i targeted it. im
 using wicket 1.4.1.

The ListView ist replaced with it's childs. Therefore you can not update
the ListView. The simple solution to this is a WebMarkupContainer around
the ListView.

mm:)

-- 
Michael Mosmann http://www.wicket-praxis.de/blog/


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



Re: Update ListView using ajax

2009-09-06 Thread freak182

Hello,

i think i already put it in the webmarkupcontainer and target the
markupcontainer.


michael mosmann wrote:
 
 Am Sonntag, den 06.09.2009, 01:05 +0800 schrieb Eman Nollase:
 Hello,
 
 For no apparent reason the listview is not updating when i targeted it.
 im
 using wicket 1.4.1.
 
 The ListView ist replaced with it's childs. Therefore you can not update
 the ListView. The simple solution to this is a WebMarkupContainer around
 the ListView.
 
 mm:)
 
 -- 
 Michael Mosmann http://www.wicket-praxis.de/blog/
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Update-ListView-using-ajax-tp25310457p25317613.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Update ListView using ajax

2009-09-06 Thread Michael Mosmann
Hi,

 i think i already put it in the webmarkupcontainer and target the
 markupcontainer.

ok.. 
my fault.. sorry.

can you post some more code.. i am not sure to see the full picture yet.

 For no apparent reason the listview is not updating when i targeted it. im
 using wicket 1.4.1.

does it work without ajax?

mm:)



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



Re: Update ListView using ajax

2009-09-06 Thread freak182

hello,

here is the codes:

final FormVoid form = new FormVoid(search);
add(form);

final TextFieldString query = new TextFieldString(query, new
PropertyModelString(this, search) );
form.add(query);

ListCustomFileDescription results = null;
final WebMarkupContainer resultcontainer = new
WebMarkupContainer(resultcontainer);
add(resultcontainer.setOutputMarkupId(true));

final ListViewCustomFileDescription files = new
ListViewCustomFileDescription(files, results)
{
@Override
protected void populateItem(ListItemCustomFileDescription item)
{
final CustomFileDescription fileDesc = item.getModelObject();
item.setModel(new 
CompoundPropertyModelCustomFileDescription(fileDesc));
item.add(new Label(name));
item.add(new Label(lastModified));
}
};
//files.setReuseItems(true);
resultcontainer.add(files);

final IndicatingAjaxButton buttquery = new 
IndicatingAjaxButton(submit,
form)
{

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form)
{
final ListCustomFileDescription results =
fileSearchService.search(query.getDefaultModelObjectAsString());
System.out.println(results.size());
files.setDefaultModelObject(results);
target.addComponent(resultcontainer);
}
};
form.add(buttquery);

...and im pretty sure that i already some code in previous version of wicket
and it work..but i dont know what im missing right now. maybe worst case i
will do is to go back to old version of wicket but i want the latest
version.

Thanks a lot.
Cheers.


michael mosmann wrote:
 
 Hi,
 
 i think i already put it in the webmarkupcontainer and target the
 markupcontainer.
 
 ok.. 
 my fault.. sorry.
 
 can you post some more code.. i am not sure to see the full picture yet.
 
 For no apparent reason the listview is not updating when i targeted it.
 im
 using wicket 1.4.1.
 
 does it work without ajax?
 
 mm:)
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Update-ListView-using-ajax-tp25310457p25324461.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Update ListView using ajax

2009-09-05 Thread Eman Nollase
Hello,

For no apparent reason the listview is not updating when i targeted it. im
using wicket 1.4.1.

here is the code:

final WebMarkupContainer resultcontainer = new
WebMarkupContainer(resultcontainer);
add(resultcontainer.setOutputMarkupId(true));

final ListViewCustomFileDescription files = new
ListViewCustomFileDescription(files, results)
{
@Override
protected void populateItem(ListItemCustomFileDescription item)
{
final CustomFileDescription fileDesc = item.getModelObject();
item.setModel(new
CompoundPropertyModelCustomFileDescription(fileDesc));
item.add(new Label(name));
item.add(new Label(lastModified));
}
};
//files.setReuseItems(true);
resultcontainer.add(files);

final ListCustomFileDescription results =
fileSearchService.search(query.getDefaultModelObjectAsString());
System.out.println(results.size());
files.setDefaultModelObject(results);
target.addComponent(resultcontainer);

...the results are just appending to each other.

Thanks a lot.
Cheers.