Re: Enclosure around a RefreshingView

2019-06-29 Thread Martin Grigorov
Hi,


On Fri, Jun 28, 2019 at 6:25 PM Boris Goldowsky  wrote:

> What’s the best practice for a list (built in this case with a
> RefreshingView) that has a header, which should be hidden if the list is
> empty?
>
> The most obvious would be to wrap  around the whole
> thing, but the RefreshingView is still considered visible even when empty,
> so that doesn’t work by itself.
>
> I tried adding an onConfigure method to set visibility based on the
> repeater’s size(), but the children don’t actually get added to the
> repeater until after onConfigure runs, so size() always returns 0.
>

Actually the children are added
in org.apache.wicket.markup.repeater.AbstractRepeater#onBeforeRender(), so
you need to override this one, call super.onBeforeRender() and then check
the size.

I'd recommend you to use EnclosureContainer instead of 
because the latter has many known bugs.


>
> There are ways I can brute force this of course.  But is there a clean,
> general solution?
>
> Boris
>
>


Enclosure around a RefreshingView

2019-06-28 Thread Boris Goldowsky
What’s the best practice for a list (built in this case with a RefreshingView) 
that has a header, which should be hidden if the list is empty?

The most obvious would be to wrap  around the whole thing, 
but the RefreshingView is still considered visible even when empty, so that 
doesn’t work by itself.

I tried adding an onConfigure method to set visibility based on the repeater’s 
size(), but the children don’t actually get added to the repeater until after 
onConfigure runs, so size() always returns 0.

There are ways I can brute force this of course.  But is there a clean, general 
solution?

Boris



Re: ListView vs. RefreshingView and the meaning of the word 'refreshing'

2016-08-09 Thread Sven Meier

Hi,

yes, ListView and RefreshingView are quite similar.

ListView is a repeater implementation from Wicket's very early days: it 
works on a list of objects - wrapped in a model of course, as you'd 
expect it from a proper Wicket component.


RefreshingView doesn't care where the objects to iterate over come from: 
getItemModels() provides a list of models of objects, something you can 
get from a dataProvider.
"Refreshing" is related to "create a fresh component" for each new 
model, i.e. a model for which a component hasn't been created before.


Have fun
Sven


On 08.08.2016 12:08, Davids Patrick wrote:

Hi all,
a question, I have in mind since about 3 years but I never asked... ;-)
Don't know why, now, I do...

ListViews and RefreshingViews are very similar.

Especially due to the default flag setReuseItems false of ListView, they both behave 
"refreshing" to me.
(populating items is called each request)

So, now my question(s)...
Does the word "Refreshing" is more related to the method getItemModels(...) of 
RefreshingView?
Does it mean, fetching a "fresh" new model implementation of the particular 
item?
Or does it mean fetching a "fresh" new component instance of the particular 
item?
Or does it mean always reading "fresh" data of some "dataprovider"/listmodel?

best regards
Patrick

Health AG | Patrick Davids | Softwareentwickler
Tel. +49 40 524 709-258 | p.dav...@healthag.de
Fax +49 40 524 709-258 | www.healthag.de


EOS Health Honorarmanagement AG | Lübeckertordamm 1–3 | 20099 Hamburg | AG 
Hamburg HRB 93806
Vorstand | Jens Törper, Uwe Schäfer
Aufsichtsratsvorsitzender | Klaus Engberding

Save a tree – think before you print.



-
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



ListView vs. RefreshingView and the meaning of the word 'refreshing'

2016-08-08 Thread Davids Patrick
Hi all,
a question, I have in mind since about 3 years but I never asked... ;-)
Don't know why, now, I do...

ListViews and RefreshingViews are very similar.

Especially due to the default flag setReuseItems false of ListView, they both 
behave "refreshing" to me.
(populating items is called each request)

So, now my question(s)...
Does the word "Refreshing" is more related to the method getItemModels(...) of 
RefreshingView?
Does it mean, fetching a "fresh" new model implementation of the particular 
item?
Or does it mean fetching a "fresh" new component instance of the particular 
item?
Or does it mean always reading "fresh" data of some "dataprovider"/listmodel?

best regards
Patrick

Health AG | Patrick Davids | Softwareentwickler
Tel. +49 40 524 709-258 | p.dav...@healthag.de
Fax +49 40 524 709-258 | www.healthag.de


EOS Health Honorarmanagement AG | Lübeckertordamm 1–3 | 20099 Hamburg | AG 
Hamburg HRB 93806
Vorstand | Jens Törper, Uwe Schäfer
Aufsichtsratsvorsitzender | Klaus Engberding

Save a tree – think before you print.



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



Re: Refreshingview vs ListView

2016-07-28 Thread Entropy
Thanks for the suggestion.  I think so.  

public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof Expense))
return false;
Expense castOther = (Expense) other;

if (this.getId() == null)
return false;
if (castOther.getId() == null)
return false;

return castOther.getId().equals(this.getId());
}

public int hashCode() {
int result = 17;

if (getId() != null)
result = result * getId().hashCode();

return result;
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshingview-vs-ListView-tp4675224p4675236.html
Sent from the Users forum 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: Refreshingview vs ListView

2016-07-28 Thread Jonas
Have you checked that equals/hashCode of your items are implemented
properly?
In our application, broken equals/hashCode was the most frequent reason for
item reuse not working properly.

Cheers,
Jonas

On Wed, Jul 27, 2016 at 6:02 PM, Entropy  wrote:

> I replaced the RefreshingView with a PropertyListView again, and it fixed
> the
> validation message issue.  All other changes were still there.
> Unfortunately, it also breaks my new feature as the ListView won't update
> on
> Save.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Refreshingview-vs-ListView-tp4675224p4675226.html
> Sent from the Users forum 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: Refreshingview vs ListView

2016-07-27 Thread Entropy
I replaced the RefreshingView with a PropertyListView again, and it fixed the
validation message issue.  All other changes were still there. 
Unfortunately, it also breaks my new feature as the ListView won't update on
Save.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshingview-vs-ListView-tp4675224p4675226.html
Sent from the Users forum 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



Refreshingview vs ListView

2016-07-27 Thread Entropy
We have a section written by another developer who is gone that I am
attempting to modify.  It was a ListView where items are added via a plus
button, and all items are editable.  A new requirement came down to modify
some text in the fields on save.  

I modified the fields as we saved, then add the container to the target and
made the Listview a RefreshingView.  This gets the behavior I want, but now
our validation messages near the boxes no longer show (the message at the
top saying there ARE error does still show, so the validators are running,
just not showing).  Also, when I modify a box for update, and then hit our
plus button to add a row, the updates revert back to their last saved state.

I double checked, the ListView variant of the page did not have these
issues.  Looking at a beyond compare of the changes, I feel like the change
from listView to RefreshingView was far and away the most significant
change, and that is where I am focusing for now.  I notice his ListView had
setReuseItems(true).  I tried setting the
RefreshingView.setItemReuseStrategy to both the reuse and default strategies
and neither made a difference.

Can anyone give me a pointer?  Does this symptom make you suspect a
particular mistake I might have made?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshingview-vs-ListView-tp4675224.html
Sent from the Users forum 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: Question regarding index handling with RefreshingView and OddEvenItem

2015-02-16 Thread Martijn Dashorst
Why not use pure css for zebra striping? adding classes for odd/even
is rather oldschool...

tbody tr:nth-child(odd) { background-color: #ccc; }

Martijn

On Sun, Feb 15, 2015 at 3:56 PM, Thorsten Schöning
 wrote:
> Hi all,
>
> I'm using DataView to publish some search results in a HTML table and
> what the results to format zebra style. I've found OddEvenItem for
> that purpose but ran into what I find is a problem: The first item is
> always rendered with CSS class "even", because the index used is 0
> based. That may be correct from a technical point of view, but is not
> what I want to present my users.
>
> So I changed my creation of OddEvenItem to simply not provide index 0,
> but found that my provided index is always ignored. Even if I change
> my index to a constant like 1 it is ignored.
>
> I found the problem in RefreshingView.addItems, where a loop is used
> to iterate over items and an index is always set:
>
>> protected void addItems(Iterator> items)
>> {
>>   int index = 0;
>>   while (items.hasNext())
>>   {
>>   Item item = items.next();
>>   item.setIndex(index);
>>   add(item);
>>   ++index;
>>   }
>> }
>
> This doesn't make sense to me, because the OddEvenItem ctor is
> designed to take an index, which is afterwards ignored.
>
> Two questions here:
>
> 1. Is the call to setIndex by design and one should override setIndex in
> custom created items to just ignore that call? In that case the
> documentation for Item should make that more clear, unless I have
> missed that.
>
> 2. How should I get my OddEvenItem to print CSS classes based on a 1
> index at all? Should I override onComponentTag instead of changing the
> index to 1 in my newItem-method?
>
> Thanks für help!
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
> AM-SoFT IT-Systeme  http://www.AM-SoFT.de/
>
> Telefon...05151-  9468- 55
> Fax...05151-  9468- 88
> Mobil..0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: Question regarding index handling with RefreshingView and OddEvenItem

2015-02-15 Thread Stefan Renz
Hi,

I know that I'm skirting around answering your questions, but
you could add an AttributeAppender to the item based on the index.
Something like

item.add( AttributeAppender.modify( "class", item.getIndex() % 2 == 1 ?
getEvenCssClass() : getOddCssClass() );

Apply further refactorings to suit your needs, i.e. introduce your own
subclass of Behavior/AttributeModifier which provides the attribute
appender functionality plus getEvenCssClass() and getOddCssClass(). This
way, you can apply your even/odd styling to all you DataViews, and have
your style information in one place. Plus you can use stock DataTable or
ListView.

Thorsten Schöning wrote:
> Hi all,
> 
> I'm using DataView to publish some search results in a HTML table and
> what the results to format zebra style. I've found OddEvenItem for
> that purpose but ran into what I find is a problem: The first item is
> always rendered with CSS class "even", because the index used is 0
> based. That may be correct from a technical point of view, but is not
> what I want to present my users.

I kind of don't understand: you want to present a zebra table to your
users, that is what you do. But what exactly do you want to achieve?
First row is termed "odd" instead of "even"? Why would that matter?
Can't you just flip your CSS classes if styling is your concern?

> 
> So I changed my creation of OddEvenItem to simply not provide index 0,
> but found that my provided index is always ignored. Even if I change
> my index to a constant like 1 it is ignored.
> 
> I found the problem in RefreshingView.addItems, where a loop is used
> to iterate over items and an index is always set:
> 
>> protected void addItems(Iterator> items)
>> {
>>   int index = 0;
>>   while (items.hasNext())
>>   {
>>   Item item = items.next();
>>   item.setIndex(index);
>>   add(item);
>>   ++index;
>>   }
>> }
> 
> This doesn't make sense to me, because the OddEvenItem ctor is
> designed to take an index, which is afterwards ignored.
> 
> Two questions here:
> 
> 1. Is the call to setIndex by design and one should override setIndex in
> custom created items to just ignore that call? In that case the
> documentation for Item should make that more clear, unless I have
> missed that.

I think the contract between DataTable and Item is Item#setIndex, not
the constructor of the specialization OddEvenItem. I find it rather
dangerous to modify the indexes by skipping zero etc. as this may change
Wicket's internal bookkeeping of items.


> 
> 2. How should I get my OddEvenItem to print CSS classes based on a 1
> index at all? Should I override onComponentTag instead of changing the
> index to 1 in my newItem-method?
> 
> Thanks für help!
> 
> Mit freundlichen Grüßen,
> 
> Thorsten Schöning
> 

Hope this helps, bye
Stefan

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



Question regarding index handling with RefreshingView and OddEvenItem

2015-02-15 Thread Thorsten Schöning
Hi all,

I'm using DataView to publish some search results in a HTML table and
what the results to format zebra style. I've found OddEvenItem for
that purpose but ran into what I find is a problem: The first item is
always rendered with CSS class "even", because the index used is 0
based. That may be correct from a technical point of view, but is not
what I want to present my users.

So I changed my creation of OddEvenItem to simply not provide index 0,
but found that my provided index is always ignored. Even if I change
my index to a constant like 1 it is ignored.

I found the problem in RefreshingView.addItems, where a loop is used
to iterate over items and an index is always set:

> protected void addItems(Iterator> items)
> {
>   int index = 0;
>   while (items.hasNext())
>   {
>   Item item = items.next();
>   item.setIndex(index);
>   add(item);
>   ++index;
>   }
> }

This doesn't make sense to me, because the OddEvenItem ctor is
designed to take an index, which is afterwards ignored.

Two questions here:

1. Is the call to setIndex by design and one should override setIndex in
custom created items to just ignore that call? In that case the
documentation for Item should make that more clear, unless I have
missed that.

2. How should I get my OddEvenItem to print CSS classes based on a 1
index at all? Should I override onComponentTag instead of changing the
index to 1 in my newItem-method?

Thanks für help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Hi Martin,

I'm sorry to bother you with a second post. 

I have reproduced the behaviour described above in a simple project ( 
refreshingview.zip
<http://apache-wicket.1842946.n4.nabble.com/file/n4669090/refreshingview.zip> 
). Also, I put the mercurial project on bitbucket( hg clone
https://luc...@bitbucket.org/lucast/refreshingview).


The behaviour is as follow. 

Step 1, choose a number (3, for example) from the drop down list. A list of
3 entries of text fields will be displayed.

Step 2, choose a different number (2, for example) from the drop down list.
Only one entry of text field will be displayed. Even though the list model
has 2 entries, not one.

When an entry from the drop down list, located in HomePage is selected,
PersonListFormComponentPanel is updated.

On running the debugger, I noticed that inside
ReuseIfModelsEqualStrategy.getItems(), (line 86), on the bit that compares 
if (oldItem == null), on the first run, oldItem *is* null.
On the second run, *oldItem* *is not*.

That is why PersonRefreshingView.populateItem() is not called the second
time a number is selected from the drop down list.

How can I set *oldItem* to null so that it follows the very same behaviour
as when executed the first time?

If you happen to look inside
PersonListFormComponentPanel.PersonRefreshingView, you will notice that I
have implemented PersonModel, with equals and hashcode functions.


Anyway, this is something I honestly cannot get my head around. I have tried
for days now and I find it most puzzling.

Any tips, or hints in the right direction will be much appreciated.

Thanks, once more,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669090.html
Sent from the Users forum 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: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Hi Martin,
Thank you for taking the time to reply.

I have implemented hashcode and equals on the object, and the Model class
used inside the RefreshingView and the ListModel class that is passed to the
RefreshingView.


In order to be able to display the right number of entries, I clear the list
inside the ListModel and populate it again with  N numbers of initialized
objects. The variables in those objects are all null. 


This works on the first run but not on the second.

In stepping through the code with debugger, hashcode and equal are called
only for the the actual object and the model object, not for the ListModel.

Since all objects are empty (no variables have been populated) the models
and the actual objects all return the same hash code.

But this surely is of no relevance since I am using a List, not a set. 

I've been looking at this for a while, and perhaps I have lost the sense of
perspective, but I cannot see what I am doing wrong.

Kind regards,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669088.html
Sent from the Users forum 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: validation in form component panels in RefreshingView

2015-01-22 Thread Martin Grigorov
Hi,

On Thu, Jan 22, 2015 at 3:16 PM, lucast  wrote:

> Thank you, Martin,
>
> I have used ReuseIfModelsEqualStrategy and the validation message side of
> it
> work but now I have a different problem.
>
> When I navigate away from the form panel, update the list of objects and
> navigate back to the FormComponentPanel that holds the RefreshingView, only
> one item from the list gets displayed.
>
> I use a ListModel to pass the list of objects to the FormComponentPanel.
>
> When used for the first time, the RefreshingView calls getItemModels() and
> populateItem(), but after updating the ListModel, RefreshingView only calls
> getItemModels() and *not* populateItem().
>
> Would you happen to know why that is?
>
> If I use DefaultItemReuseStrategy.getInstance() then  getItemModels() and
> populateItem() get called every time. But that just takes me back to square
> 1.
>
> I'm not sure if this is relevant. ReuseIfModelsEqualStrategy documentation
> states that " the model and not the model object needs to implement the
> Object.equals(Object) and Object.hashCode() methods".
>
> I'm terribly sorry but I'm not sure completely understand that statement.
> Would that be something to do with the RefreshingView not displaying all
> items in the list model.
>

This says that your model object has to have proper impls of #equals() and
#hashCode() methods. Just like when you put instances of this class in
HashMap.

I guess this will solve your problem.


>
> On trying to interpret that statement, on RefreshingView.getItemModels(), I
> return an anonymous class that extends ModelIteratorAdapter. And on
> ModelIteratorAdapter.model, I return an custom Model with extends Model Application Object>. It is there that I implement hashcode and equals. But
> the problem still persists.
>
> I hope I'm not making things more confusing by writing extensively, but I
> just wanted to put it out there, in case there was something simple and
> small that I am missing.
>
> Thanks in advance,
> Lucas
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669081.html
> Sent from the Users forum 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: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Thank you, Martin,

I have used ReuseIfModelsEqualStrategy and the validation message side of it
work but now I have a different problem.

When I navigate away from the form panel, update the list of objects and
navigate back to the FormComponentPanel that holds the RefreshingView, only
one item from the list gets displayed.

I use a ListModel to pass the list of objects to the FormComponentPanel.

When used for the first time, the RefreshingView calls getItemModels() and
populateItem(), but after updating the ListModel, RefreshingView only calls
getItemModels() and *not* populateItem(). 

Would you happen to know why that is?

If I use DefaultItemReuseStrategy.getInstance() then  getItemModels() and
populateItem() get called every time. But that just takes me back to square
1.

I'm not sure if this is relevant. ReuseIfModelsEqualStrategy documentation
states that " the model and not the model object needs to implement the
Object.equals(Object) and Object.hashCode() methods".

I'm terribly sorry but I'm not sure completely understand that statement.
Would that be something to do with the RefreshingView not displaying all
items in the list model.

On trying to interpret that statement, on RefreshingView.getItemModels(), I
return an anonymous class that extends ModelIteratorAdapter. And on
ModelIteratorAdapter.model, I return an custom Model with extends Model. It is there that I implement hashcode and equals. But
the problem still persists.

I hope I'm not making things more confusing by writing extensively, but I
just wanted to put it out there, in case there was something simple and
small that I am missing.

Thanks in advance,
Lucas




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669081.html
Sent from the Users forum 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: validation in form component panels in RefreshingView

2015-01-21 Thread Martin Grigorov
org.apache.wicket.markup.repeater.RefreshingView#setItemReuseStrategy(org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy#getInstance())

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 21, 2015 at 6:59 PM, lucast  wrote:

> Dear forum,
>
> I'm implementing a tabbed panel.
> On first panel, user selects number of items. On second tab, user enters
> details for each item.
>
> I've implemented a RefreshingView so that the number of items on list
> reflects the number of items selected by user.
>
> To bundle all of the fields together I use a form component panel and for
> each entry on the RefreshingView, I add a form component panel.
>
> The text fields have FieldDecorators, as explained on the Apache Wicket
> Cookbook, chapter 3.
>
> The problem is that when I submit the form, the error messages for each
> field are not shown on the text field FieldDecorators.
>
> If I use RepeatingView, error messages are displayed as intended. But my
> list is dynamic.
>
> How can I get the proper validation message displayed inside the form
> component panel, used in a RefreshingView?
>
> Thanks in advance,
> Lucas
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068.html
> Sent from the Users forum 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
>
>


validation in form component panels in RefreshingView

2015-01-21 Thread lucast
Dear forum,

I'm implementing a tabbed panel. 
On first panel, user selects number of items. On second tab, user enters
details for each item.

I've implemented a RefreshingView so that the number of items on list
reflects the number of items selected by user.

To bundle all of the fields together I use a form component panel and for
each entry on the RefreshingView, I add a form component panel.

The text fields have FieldDecorators, as explained on the Apache Wicket
Cookbook, chapter 3.

The problem is that when I submit the form, the error messages for each
field are not shown on the text field FieldDecorators.

If I use RepeatingView, error messages are displayed as intended. But my
list is dynamic.

How can I get the proper validation message displayed inside the form
component panel, used in a RefreshingView?

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068.html
Sent from the Users forum 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-Usable Panel with RefreshingView

2013-11-07 Thread Patrick Davids
Hi all,
I would like to implement a reusable panel, containing a refreshing view.

The goal is to delegate the polulateItem(Item item) of the refreshing 
view to the outer client, e.g. the page which uses my panel.
(I force overriding using abstract method).

So far so good.

My problem now is:
My inner refreshing view must provide a webmarkup container, I must use 
to add my custom components from outside (populateItem(item){ 
item.add(myCUstomComponent) }).

Quite ok... but I need to know the inner id in the outer client (kind of 
LazyLoadingPanel), but I dont want having it in this way, providing my 
inner id to the outer "world".

What kind of Repeating/RefreshingView should I use?

I think, I need some sort of mixed Repeating&RefreshignView feature.

RepeatingView works with newChildId(), and can have outer markup (hope I 
understood right),but is not very refreshing.
RefreshingView works in a refreshing way, but must hold its own markup.

Can anyone give some inspiration and help for my reusable panel?

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



Re: Add or remove a row in RefreshingView with Ajax

2013-10-25 Thread MartinoSuperman
Hi,

Thanks for the advice. You're right. I also read those pages.

I already implemented it.

But now my question is:

I put the RefreshingView in a panel. And that panel is situated a
WebMarkupContainer. After I pressed the button on submit of Ajax, the
RefreshingView should refresh, but still it does not work.

Which commands do I have to use to make that refreshing possible? Do I have
to replace the whole RefreshingView for example?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944p4661960.html
Sent from the Users forum 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: Add or remove a row in RefreshingView with Ajax

2013-10-25 Thread Martin Grigorov
On Fri, Oct 25, 2013 at 4:18 AM, Colin Rogers <
colin.rog...@objectconsulting.com.au> wrote:

> Hi there,
>
> Not sure what you mean by 'does not work'... so guessing the issue, and
> the solution.
>
> Are you updating the whole RepeatingView? If so, you need to wrap the
> repeater in a WebMarkupContainer and refresh that (remembering to
> setOutputMarkupId to true etc.)
>
> I don't know the reason why, but repeaters have to be updated via their
> parent container.
>

The reason is because repeaters' have no markup. The markup you provide is
used for the repeater's items.

Check
http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/


>
> Cheers,
> Col.
>
> -Original Message-
> From: MartinoSuperman [mailto:martinosuper...@live.nl]
> Sent: Friday, October 25, 2013 3:36 AM
> To: users@wicket.apache.org
> Subject: Add or remove a row in RefreshingView with Ajax
>
> Hi,
>
> I have a RefreshingView, which consists of TextFields, Labels and a
> DownloadLink.
>
> When a button is pressed, a new row should be added with the help of Ajax.
>
> Unfortunately, this does not work.
>
> Can somebody tell me what I have to program to make adding and removing
> rows in RefreshingView possible?
>
> Thanks in advance!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944.html
> Sent from the Users forum 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
>
> EMAIL DISCLAIMER This email message and its attachments are confidential
> and may also contain copyright or privileged material. If you are not the
> intended recipient, you may not forward the email or disclose or use the
> information contained in it. If you have received this email message in
> error, please advise the sender immediately by replying to this email and
> delete the message and any associated attachments. Any views, opinions,
> conclusions, advice or statements expressed in this email message are those
> of the individual sender and should not be relied upon as the considered
> view, opinion, conclusions, advice or statement of this company except
> where the sender expressly, and with authority, states them to be the
> considered view, opinion, conclusions, advice or statement of this company.
> Every care is taken but we recommend that you scan any attachments for
> viruses.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


RE: Add or remove a row in RefreshingView with Ajax

2013-10-24 Thread Colin Rogers
Hi there,

Not sure what you mean by 'does not work'... so guessing the issue, and the 
solution.

Are you updating the whole RepeatingView? If so, you need to wrap the repeater 
in a WebMarkupContainer and refresh that (remembering to setOutputMarkupId to 
true etc.)

I don't know the reason why, but repeaters have to be updated via their parent 
container.

Cheers,
Col.

-Original Message-
From: MartinoSuperman [mailto:martinosuper...@live.nl]
Sent: Friday, October 25, 2013 3:36 AM
To: users@wicket.apache.org
Subject: Add or remove a row in RefreshingView with Ajax

Hi,

I have a RefreshingView, which consists of TextFields, Labels and a 
DownloadLink.

When a button is pressed, a new row should be added with the help of Ajax.

Unfortunately, this does not work.

Can somebody tell me what I have to program to make adding and removing rows in 
RefreshingView possible?

Thanks in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944.html
Sent from the Users forum 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

EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.

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



Add or remove a row in RefreshingView with Ajax

2013-10-24 Thread MartinoSuperman
Hi,

I have a RefreshingView, which consists of TextFields, Labels and a
DownloadLink.

When a button is pressed, a new row should be added with the help of Ajax. 

Unfortunately, this does not work.

Can somebody tell me what I have to program to make adding and removing rows
in RefreshingView possible?

Thanks in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944.html
Sent from the Users forum 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: Checking all input in refreshingview and set focus

2012-07-28 Thread Francois Meillet
have a look to https://cwiki.apache.org/WICKET/reference-library.html

François

Le 25 juil. 2012 à 09:06, Delange a écrit :

> Hi, 
> i have an refreshingview with input fields. 
> 
> How can I check every field in a row and set focus on it when it's wrong? 
> (Validators can not be used for all fields, for example article code etc.)
> 
> 
> 
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Checking-all-input-in-refreshingview-and-set-focus-tp4650772.html
> Sent from the Users forum 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



Checking all input in refreshingview and set focus

2012-07-25 Thread Delange
Hi, 
i have an refreshingview with input fields. 

How can I check every field in a row and set focus on it when it's wrong? 
(Validators can not be used for all fields, for example article code etc.)




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Checking-all-input-in-refreshingview-and-set-focus-tp4650772.html
Sent from the Users forum 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: RefreshingView - Comparing Items in List Model

2011-06-01 Thread Igor Vaynberg
alternatively override renderiterator() and sort your items there.

-igor

On Wed, Jun 1, 2011 at 8:45 AM, Corbin, James  wrote:
> I was able to solve this issue by defining a new class that extends 
> LoadableDetachableModel.  The class also overrides hashcode and equals 
> appropriately.  Now my List> (used by RefreshingView) contains 
> instances for the new detachable model implementation and now list 
> manipulation works just fine and my manual row reordering logic works 
> perfectly.
>
>
> Regards,
> J.D.
> -Original Message-
> From: Corbin, James [mailto:jcor...@iqnavigator.com]
> Sent: Wednesday, June 01, 2011 8:56 AM
> To: users@wicket.apache.org
> Subject: RefreshingView - Comparing Items in List Model
>
> I am using a RefreshingView for a fairly simple table layout with the 
> exception that one of columns in the table contains actions to move rows up 
> and down (e.g., re-order rows).
>
> My model for the RefreshingView is basically a List> where T is my 
> POJO.
>
> The approach I was going to take was to have the buttons (move up/down) 
> manipulate the underlying model by repositioning the IModel instances in 
> the ordered List.  In order to do this, I need to identify the index position 
> of a particular item (IModel) in the list.
>
> My T instances have equals and hashcode defined, but wondered if my IModel 
> instances need to be detachable models that also define hashcode and equals 
> as well.
>
> Is this the right approach?
>
> J.D.
>
>
>
> -
> 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: RefreshingView - Comparing Items in List Model

2011-06-01 Thread Corbin, James
I was able to solve this issue by defining a new class that extends 
LoadableDetachableModel.  The class also overrides hashcode and equals 
appropriately.  Now my List> (used by RefreshingView) contains 
instances for the new detachable model implementation and now list manipulation 
works just fine and my manual row reordering logic works perfectly.


Regards,
J.D.
-Original Message-
From: Corbin, James [mailto:jcor...@iqnavigator.com] 
Sent: Wednesday, June 01, 2011 8:56 AM
To: users@wicket.apache.org
Subject: RefreshingView - Comparing Items in List Model

I am using a RefreshingView for a fairly simple table layout with the exception 
that one of columns in the table contains actions to move rows up and down 
(e.g., re-order rows).

My model for the RefreshingView is basically a List> where T is my 
POJO.

The approach I was going to take was to have the buttons (move up/down) 
manipulate the underlying model by repositioning the IModel instances in the 
ordered List.  In order to do this, I need to identify the index position of a 
particular item (IModel) in the list.

My T instances have equals and hashcode defined, but wondered if my IModel 
instances need to be detachable models that also define hashcode and equals as 
well.

Is this the right approach?

J.D.



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



RefreshingView - Comparing Items in List Model

2011-06-01 Thread Corbin, James
I am using a RefreshingView for a fairly simple table layout with the exception 
that one of columns in the table contains actions to move rows up and down 
(e.g., re-order rows).

My model for the RefreshingView is basically a List> where T is my 
POJO.

The approach I was going to take was to have the buttons (move up/down) 
manipulate the underlying model by repositioning the IModel instances in the 
ordered List.  In order to do this, I need to identify the index position of a 
particular item (IModel) in the list.

My T instances have equals and hashcode defined, but wondered if my IModel 
instances need to be detachable models that also define hashcode and equals as 
well.

Is this the right approach?

J.D.




Re: RepeatingView/RefreshingView: Inform children about being deleted

2011-02-18 Thread Igor Vaynberg
file a bug with a quickstart. onremove() should be called on all
removed components.

-igor

On Fri, Feb 18, 2011 at 5:38 AM, Benedikt Rothe  wrote:
> Hi
>
> Are the existing children of a RepeatingView/RefreshingView being informed,
> when
> the View is newly populated (RefreshingView.onPopulate).
>
> I'd like to clean some internal references in this case.
> I tried:
> - aChild.onRemove is not called in this situation
> - aChild.setParent(null) is called. I treid to override setParent it. But
> setParent is private.
>
> Any suggestions?
> Benedikt
>
> -
> 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



RepeatingView/RefreshingView: Inform children about being deleted

2011-02-18 Thread Benedikt Rothe

Hi

Are the existing children of a RepeatingView/RefreshingView being 
informed, when

the View is newly populated (RefreshingView.onPopulate).

I'd like to clean some internal references in this case.
I tried:
- aChild.onRemove is not called in this situation
- aChild.setParent(null) is called. I treid to override setParent it. 
But setParent is private.


Any suggestions?
Benedikt

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



Re: RefreshingView

2009-09-27 Thread garz

ah noo i am wrong, the type parameter is for the items that are used inside,
not for the model of the refreshingview itself. my fault, sry. :D though but
your answer didnt help me to find that out... ;)


MartinM wrote:
> 
> It has getDefaultModelObject etc??
> 
> **
> Martin
> 
> 2009/9/27  :
>> heyho,
>>
>> public abstract class RefreshingView extends RepeatingView has the
>> typeparameter but no public IModel getModel(). can someone add it
>> please or let me add it, i would do it too, plus setModel(),
>> setModelObject(), getModelObject().
>>
>> regarz
>> --
>> Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
>> für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
>>
>> -
>> 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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RefreshingView-tp25636765p25637138.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: RefreshingView

2009-09-27 Thread Igor Vaynberg
RefreshingView component does not use its model and therefore does not
provide typesafe getters, mostly because it is possible to use any
kind of model object with it.

-igor

On Sun, Sep 27, 2009 at 12:30 PM,   wrote:
> heyho,
>
> public abstract class RefreshingView extends RepeatingView has the 
> typeparameter but no public IModel getModel(). can someone add it please 
> or let me add it, i would do it too, plus setModel(), setModelObject(), 
> getModelObject().
>
> regarz
> --
> Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
>
> -
> 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: RefreshingView

2009-09-27 Thread Martin Makundi
It has getDefaultModelObject etc??

**
Martin

2009/9/27  :
> heyho,
>
> public abstract class RefreshingView extends RepeatingView has the 
> typeparameter but no public IModel getModel(). can someone add it please 
> or let me add it, i would do it too, plus setModel(), setModelObject(), 
> getModelObject().
>
> regarz
> --
> Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
> für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
>
> -
> 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



RefreshingView

2009-09-27 Thread Garz
heyho,

public abstract class RefreshingView extends RepeatingView has the 
typeparameter but no public IModel getModel(). can someone add it please or 
let me add it, i would do it too, plus setModel(), setModelObject(), 
getModelObject().

regarz
-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

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



Validate RefreshingView

2009-09-22 Thread Hakan . Steisjo
Hi,

I've got a problem that I hope someone can help me with and point me in 
the right direction. Is there a way in the validation phase to validate 
that a refreshingview contain items?

My scenario:

I've got a page that holds a form, an ajaxsubmitlink and a panel. The 
panel in turn has some input controls plus two other panels. The first 
nested panel holds a refreshingview where the user can add items using a 
textfield (in the same panel). I need to validate that the user has added 
atleast one item to the refreshingview, is there a way I can do that? I 
could use the ajaxsubmitlink's onSubmit function in the page, but that 
will cause problems in the second nested panel if the validation fails 
since no database activity will then take place and as I've read somewhere 
because Wicket clones the modelobject in submits. So that would mean 
anything entered in the second nested panel will be lost.

-Håkan

Re: Validate refreshingview

2009-09-22 Thread Igor Vaynberg
you can use embedded forms, afair onsubmit of an inner form is called
before onsubmit of outer.

-igor

On Tue, Sep 22, 2009 at 1:12 PM,   wrote:
>
> Hi,
>
> I've a problem where I hope someone can point me in the right direction. I
> have a page which holds a form, an ajaxsubmitlink, and a panel containing
> formcomponents. The panel also holds two other panels, where one of the
> panels holds a refreshingview to which the user can add items, using a
> textfield in the same panel. Is there a way to add a validator to the panel
> or refreshingview that in the validate phase can check that the user has
> added atleast one item to the refreshingview?
>
> I can make this check in the onSubmit function of the ajaxsubmitlink in the
> page, but that causes problems in the second nested panel when the user has
> failed to add an item. The submit then won't result in any database
> activity and I've read somewhere that Wicket clones the modelobject on a
> submit. This causes values entered in the second nested panel to disappear.
>
> I hope someone can provide me with some help, thanks.
>
> -Håkan
>
>
> -
> 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



Validate refreshingview

2009-09-22 Thread Hakan . Steisjo

Hi,

I've a problem where I hope someone can point me in the right direction. I
have a page which holds a form, an ajaxsubmitlink, and a panel containing
formcomponents. The panel also holds two other panels, where one of the
panels holds a refreshingview to which the user can add items, using a
textfield in the same panel. Is there a way to add a validator to the panel
or refreshingview that in the validate phase can check that the user has
added atleast one item to the refreshingview?

I can make this check in the onSubmit function of the ajaxsubmitlink in the
page, but that causes problems in the second nested panel when the user has
failed to add an item. The submit then won't result in any database
activity and I've read somewhere that Wicket clones the modelobject on a
submit. This causes values entered in the second nested panel to disappear.

I hope someone can provide me with some help, thanks.

-Håkan


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



Re: RefreshingView not Refreshing

2009-09-11 Thread Troy Cauble
 wrote:
>  So for instance if a model is not detached correctly, wicket
> will use old data (don't know if the problem is in this area).

It was a load/detach problem.
I was also using the the LDM in a custom validator.
Apparently that loaded the LDM before my save & commit.
A detach() call cleared it up.

-troy

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



Re: RefreshingView not Refreshing

2009-09-11 Thread Michael Mosmann
Hi,

> Thanks, but I don't know what that implies.

If you post a form, then wicket will get the current page from session
and call the onSubmit() for the form component. Everything else is
allready there.. the RV etc.

If you reload a page, wicket will build the page again.. your old page
is gone. So for instance if a model is not detached correctly, wicket
will use old data (don't know if the problem is in this area). If you
reload the page, everything is thrown away and build from scratch. So if
your LDM is not bound to any component, detach() is never called.. the
old stuff is used.

So please send more code..

> Should I put the RV in the form?

no..

> Should I use some Ajax so I can target.addComponent(RV) ?

no.. because if it does not work without ajax, it will not work with
it..

> And most of all, why did my other variation work?
> It seems that the RV was being refreshed then.

wich wicket version do you use?

mm:)

> -troy
> 
> On Fri, Sep 11, 2009 at 2:47 AM, Michael Mosmann  wrote:
> > Hi,
> >
> >> I'm wondering why the small change (see comments)
> >> to my RV causes it to not refresh automatically.
> >> A browser refresh shows the changes.
> >
> > The Form submit does not call the page constructor, but a browser
> > refresh does.
> >
> > mm:)
> >
> >
> >
> > -
> > 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
> 


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



Re: RefreshingView not Refreshing

2009-09-11 Thread Troy Cauble
Thanks, but I don't know what that implies.
Should I put the RV in the form?
Should I use some Ajax so I can target.addComponent(RV) ?

And most of all, why did my other variation work?
It seems that the RV was being refreshed then.

-troy

On Fri, Sep 11, 2009 at 2:47 AM, Michael Mosmann  wrote:
> Hi,
>
>> I'm wondering why the small change (see comments)
>> to my RV causes it to not refresh automatically.
>> A browser refresh shows the changes.
>
> The Form submit does not call the page constructor, but a browser
> refresh does.
>
> mm:)
>
>
>
> -
> 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: RefreshingView not Refreshing

2009-09-10 Thread Michael Mosmann
Hi,

> I'm wondering why the small change (see comments)
> to my RV causes it to not refresh automatically.
> A browser refresh shows the changes.

The Form submit does not call the page constructor, but a browser
refresh does.

mm:)



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



RefreshingView not Refreshing

2009-09-10 Thread Troy Cauble
I have a RefreshingView followed by (not in) a Form.
On form submit, an object is added to the db list
associated with the RefreshingView.

I'm wondering why the small change (see comments)
to my RV causes it to not refresh automatically.
A browser refresh shows the changes.

Thanks,
-troy

private class FooRV extends RefreshingView
{
public FooRV(String id, IModel listModel)
{
super(id, listModel);
}

@Override
protected Iterator getItemModels()
{
return new ModelIteratorAdapter(
// THIS LINE WORKS
Hibby.getAllFoo().iterator()
// THIS LINE DOESN'T  -- My model is an LDM 
calling Hibby.getAllFoo()
//  ((List)getModelObject()).iterator()
) {
private static final long serialVersionUID = 1L;
@Override
protected IModel model(Object o)
{
Foo r = (Foo)o;
return new CompoundPropertyModel(
new EntityModel(Foo.class,
r.getId()));
}
};
}

// ...
}

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



Re: FeedbackIndicator doesn't work inside RefreshingView

2009-08-07 Thread konsul

I've implemented equals() and hashCode() then found and fix other problem.
And it works. Thanks a lot. 

There was the problem because I just use the code construction from example
(repeater/FormPage.java):
@Override
protected IModel model(Contact 
object)
{
return new 
CompoundPropertyModel(
new 
DetachableContactModel(object));
}
 
and the compoundproperymodel must override equals() and hashCode() in this
example instead of DetachableContactModel. I've just removed
compoundproperymodel from my code and it works.



igor.vaynberg wrote:
> 
> On Tue, Aug 4, 2009 at 12:30 PM, konsul wrote:
>>
>> I call this method:
>> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
> 
> did you also read the javadoc and implement hashcode and equals in the
> models you are using to feed items of the refreshing view?
> 
>>
>> but FeedbackIndicator still doesn't work.
>>
>> Frankly speaking I do not see any relationship between
>> FormComponentFeedbackIndicator and Model reuse strategy. I thought the
>> matter is in Feedback messages handling procedure.
> 
> the problem is that at the beginning of each request refreshingview
> will recreate all the items - which includes recreating the
> textfields. since errors are attached to the component instance they
> are essentially lost when the repeatingview item is recreated with a
> new instance of a textfield component.
> 
> the feedback messages are cached by feedbackpanels before this happens
> as they are always the first things to be updated for this exact
> reason. but the fact that the textfield is in error is lost upon the
> feedback indicator.
> 
> -igor
> 
> 
> 
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> you have to call setreuseitemstrategy(...) on the refreshingview so
>>> that components are kept across requests. it is analogous to having to
>>> call setreuseitems(true) on the listview.
>>>
>>> -igor
>>>
>>> On Tue, Aug 4, 2009 at 1:12 AM, Anton Komratov
>>> wrote:
>>>> I'm using RefreshingView to show and edit data. I put MinimumValidator
>>>> to
>>>> the TextField in RefreshingView (in method populateItem()).Also I put
>>>> FeedbackIndicator for this TextField in RefreshingView (also in method
>>>> populateItem()).
>>>>
>>>> MinimumValidator works fine - I'm getting error messages at the
>>>> FeedbackPanel. But FeedbackIndicator doesn't work - no any "red
>>>> asterics"
>>>> in
>>>> case of invalid value in TextField.
>>>> Others FeedbackIndicators at the same pages (for others TextFields
>>>> outside
>>>> of the RefreshingView) work fine.
>>>>
>>>> Any solutions? (I'm using wicket 1.4rc4).
>>>>
>>>> /// Java code fragment:
>>>>
>>>> @Override
>>>> *protected void populateItem(final Item item)* {
>>>> item.add(new Label("name"));
>>>> item.add(new Label("surname"));
>>>> item.add(new Label("city.name"));
>>>>
>>>> TextField tfam = new TextField("amount");
>>>> tfam.add(new MinimumValidator(1));
>>>> item.add(tfam);
>>>>
>>>>                                *FormComponentFeedbackIndicator
>>>> amountFlag
>>>> =
>>>> new FormComponentFeedbackIndicator ("amountFlag");*
>>>> * **amountFlag.setIndicatorFor(tfam);*
>>>> *                                item.add(amountFlag); * }
>>>> ///
>>>>
>>>> 
>>>>
>>>> **
>>>> **
>>>>  
>>>>  
>>>>  
>>>> >>> tabindex="3">
>>>> **
>>>>
>>>
>>> -----
>>> 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/FeedbackIndicator-doesn%27t-work-inside-RefreshingView-tp24804087p24814748.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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/FeedbackIndicator-doesn%27t-work-inside-RefreshingView-tp24804087p24870516.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: FeedbackIndicator doesn't work inside RefreshingView

2009-08-04 Thread Igor Vaynberg
On Tue, Aug 4, 2009 at 12:30 PM, konsul wrote:
>
> I call this method:
> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());

did you also read the javadoc and implement hashcode and equals in the
models you are using to feed items of the refreshing view?

>
> but FeedbackIndicator still doesn't work.
>
> Frankly speaking I do not see any relationship between
> FormComponentFeedbackIndicator and Model reuse strategy. I thought the
> matter is in Feedback messages handling procedure.

the problem is that at the beginning of each request refreshingview
will recreate all the items - which includes recreating the
textfields. since errors are attached to the component instance they
are essentially lost when the repeatingview item is recreated with a
new instance of a textfield component.

the feedback messages are cached by feedbackpanels before this happens
as they are always the first things to be updated for this exact
reason. but the fact that the textfield is in error is lost upon the
feedback indicator.

-igor



>
>
>
> igor.vaynberg wrote:
>>
>> you have to call setreuseitemstrategy(...) on the refreshingview so
>> that components are kept across requests. it is analogous to having to
>> call setreuseitems(true) on the listview.
>>
>> -igor
>>
>> On Tue, Aug 4, 2009 at 1:12 AM, Anton Komratov
>> wrote:
>>> I'm using RefreshingView to show and edit data. I put MinimumValidator to
>>> the TextField in RefreshingView (in method populateItem()).Also I put
>>> FeedbackIndicator for this TextField in RefreshingView (also in method
>>> populateItem()).
>>>
>>> MinimumValidator works fine - I'm getting error messages at the
>>> FeedbackPanel. But FeedbackIndicator doesn't work - no any "red asterics"
>>> in
>>> case of invalid value in TextField.
>>> Others FeedbackIndicators at the same pages (for others TextFields
>>> outside
>>> of the RefreshingView) work fine.
>>>
>>> Any solutions? (I'm using wicket 1.4rc4).
>>>
>>> /// Java code fragment:
>>>
>>> @Override
>>> *protected void populateItem(final Item item)* {
>>> item.add(new Label("name"));
>>> item.add(new Label("surname"));
>>> item.add(new Label("city.name"));
>>>
>>> TextField tfam = new TextField("amount");
>>> tfam.add(new MinimumValidator(1));
>>> item.add(tfam);
>>>
>>>                                *FormComponentFeedbackIndicator amountFlag
>>> =
>>> new FormComponentFeedbackIndicator ("amountFlag");*
>>> * **amountFlag.setIndicatorFor(tfam);*
>>> *                                item.add(amountFlag); * }
>>> ///
>>>
>>> 
>>>
>>> **
>>> **
>>>  
>>>  
>>>  
>>> >> tabindex="3">
>>> **
>>>
>>
>> -
>> 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/FeedbackIndicator-doesn%27t-work-inside-RefreshingView-tp24804087p24814748.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: FeedbackIndicator doesn't work inside RefreshingView

2009-08-04 Thread konsul

I call this method:
refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());

but FeedbackIndicator still doesn't work. 

Frankly speaking I do not see any relationship between
FormComponentFeedbackIndicator and Model reuse strategy. I thought the
matter is in Feedback messages handling procedure.



igor.vaynberg wrote:
> 
> you have to call setreuseitemstrategy(...) on the refreshingview so
> that components are kept across requests. it is analogous to having to
> call setreuseitems(true) on the listview.
> 
> -igor
> 
> On Tue, Aug 4, 2009 at 1:12 AM, Anton Komratov
> wrote:
>> I'm using RefreshingView to show and edit data. I put MinimumValidator to
>> the TextField in RefreshingView (in method populateItem()).Also I put
>> FeedbackIndicator for this TextField in RefreshingView (also in method
>> populateItem()).
>>
>> MinimumValidator works fine - I'm getting error messages at the
>> FeedbackPanel. But FeedbackIndicator doesn't work - no any "red asterics"
>> in
>> case of invalid value in TextField.
>> Others FeedbackIndicators at the same pages (for others TextFields
>> outside
>> of the RefreshingView) work fine.
>>
>> Any solutions? (I'm using wicket 1.4rc4).
>>
>> /// Java code fragment:
>>
>> @Override
>> *protected void populateItem(final Item item)* {
>> item.add(new Label("name"));
>> item.add(new Label("surname"));
>> item.add(new Label("city.name"));
>>
>> TextField tfam = new TextField("amount");
>> tfam.add(new MinimumValidator(1));
>> item.add(tfam);
>>
>>                                *FormComponentFeedbackIndicator amountFlag
>> =
>> new FormComponentFeedbackIndicator ("amountFlag");*
>> * **amountFlag.setIndicatorFor(tfam);*
>> *                                item.add(amountFlag); * }
>> ///
>>
>> 
>>
>> **
>> **
>>  
>>  
>>  
>> > tabindex="3">
>> **
>>
> 
> -
> 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/FeedbackIndicator-doesn%27t-work-inside-RefreshingView-tp24804087p24814748.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: FeedbackIndicator doesn't work inside RefreshingView

2009-08-04 Thread Igor Vaynberg
you have to call setreuseitemstrategy(...) on the refreshingview so
that components are kept across requests. it is analogous to having to
call setreuseitems(true) on the listview.

-igor

On Tue, Aug 4, 2009 at 1:12 AM, Anton Komratov wrote:
> I'm using RefreshingView to show and edit data. I put MinimumValidator to
> the TextField in RefreshingView (in method populateItem()).Also I put
> FeedbackIndicator for this TextField in RefreshingView (also in method
> populateItem()).
>
> MinimumValidator works fine - I'm getting error messages at the
> FeedbackPanel. But FeedbackIndicator doesn't work - no any "red asterics" in
> case of invalid value in TextField.
> Others FeedbackIndicators at the same pages (for others TextFields outside
> of the RefreshingView) work fine.
>
> Any solutions? (I'm using wicket 1.4rc4).
>
> /// Java code fragment:
>
> @Override
> *protected void populateItem(final Item item)* {
> item.add(new Label("name"));
> item.add(new Label("surname"));
> item.add(new Label("city.name"));
>
> TextField tfam = new TextField("amount");
> tfam.add(new MinimumValidator(1));
> item.add(tfam);
>
>                                *FormComponentFeedbackIndicator amountFlag =
> new FormComponentFeedbackIndicator ("amountFlag");*
> * **amountFlag.setIndicatorFor(tfam);*
> *                                item.add(amountFlag); * }
> ///
>
> 
>
> **
> **
>  
>  
>  
>  tabindex="3">
> **
>

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



FeedbackIndicator doesn't work inside RefreshingView

2009-08-04 Thread Anton Komratov
I'm using RefreshingView to show and edit data. I put MinimumValidator to
the TextField in RefreshingView (in method populateItem()).Also I put
FeedbackIndicator for this TextField in RefreshingView (also in method
populateItem()).

MinimumValidator works fine - I'm getting error messages at the
FeedbackPanel. But FeedbackIndicator doesn't work - no any "red asterics" in
case of invalid value in TextField.
Others FeedbackIndicators at the same pages (for others TextFields outside
of the RefreshingView) work fine.

Any solutions? (I'm using wicket 1.4rc4).

/// Java code fragment:

@Override
*protected void populateItem(final Item item)* {
item.add(new Label("name"));
item.add(new Label("surname"));
item.add(new Label("city.name"));

TextField tfam = new TextField("amount");
tfam.add(new MinimumValidator(1));
item.add(tfam);

*FormComponentFeedbackIndicator amountFlag =
new FormComponentFeedbackIndicator ("amountFlag");*
* **amountFlag.setIndicatorFor(tfam);*
*item.add(amountFlag); * }
///



**
**
 
 
 

**


Re: Can't add a Form component to an Item in RefreshingView!?

2009-07-03 Thread Fernando Wermus
Philip,
Remember that some repeaters when are refreshed change their items. You
have to instruct no to create new items instances. Take a look at ListView.
I looked for Refreshing view but I couldn't see any class like that.

bye!

On Fri, Jul 3, 2009 at 1:23 AM, Philip Watson
wrote:

> I'm new to Wicket. I'm a little impatient with this one... so here goes.
>
> I have a RefreshingView, with each item getting a Fragment component
> added to it in the populateItem() method. Each of these Fragment
> components only contain Labels. All is well here.
>
> However, whenever I add a single Fragment component that contains a
> Form I get an exception: "java.lang.ClassCastException:
> org.apache.wicket.markup.RawMarkup cannot be cast to
> org.apache.wicket.markup.ComponentTag"
>
> What I'm trying to do here is when an item is selected on a list, it
> renders the selected item as a Form to be edited rather than being
> displayed in labels. Only ONE line is selected at a time, so only need
> the one form showing. Everything else is fine... Java/markup hierarchy
> match, model usage is all good. I can get the Fragment component
> containing the form to work outside a RefreshingView. So obviously it
> has trouble rendering Forms inside a RefreshingView repeater. Can't
> work it out.
>
> Any help will be much appreciated.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


RE: Can't add a Form component to an Item in RefreshingView!?

2009-07-03 Thread Jeremy Thomerson
Hard to help you without seeing code / markup.

Jeremy Thomerson
http://www.wickettraining.com
-- sent from a wireless device


-Original Message-
From: Philip Watson 
Sent: Friday, July 03, 2009 3:23 AM
To: users@wicket.apache.org
Subject: Can't add a Form component to an Item in RefreshingView!?

I'm new to Wicket. I'm a little impatient with this one... so here goes.

I have a RefreshingView, with each item getting a Fragment component
added to it in the populateItem() method. Each of these Fragment
components only contain Labels. All is well here.

However, whenever I add a single Fragment component that contains a
Form I get an exception: "java.lang.ClassCastException:
org.apache.wicket.markup.RawMarkup cannot be cast to
org.apache.wicket.markup.ComponentTag"

What I'm trying to do here is when an item is selected on a list, it
renders the selected item as a Form to be edited rather than being
displayed in labels. Only ONE line is selected at a time, so only need
the one form showing. Everything else is fine... Java/markup hierarchy
match, model usage is all good. I can get the Fragment component
containing the form to work outside a RefreshingView. So obviously it
has trouble rendering Forms inside a RefreshingView repeater. Can't
work it out.

Any help will be much appreciated.

-
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



Can't add a Form component to an Item in RefreshingView!?

2009-07-03 Thread Philip Watson
I'm new to Wicket. I'm a little impatient with this one... so here goes.

I have a RefreshingView, with each item getting a Fragment component
added to it in the populateItem() method. Each of these Fragment
components only contain Labels. All is well here.

However, whenever I add a single Fragment component that contains a
Form I get an exception: "java.lang.ClassCastException:
org.apache.wicket.markup.RawMarkup cannot be cast to
org.apache.wicket.markup.ComponentTag"

What I'm trying to do here is when an item is selected on a list, it
renders the selected item as a Form to be edited rather than being
displayed in labels. Only ONE line is selected at a time, so only need
the one form showing. Everything else is fine... Java/markup hierarchy
match, model usage is all good. I can get the Fragment component
containing the form to work outside a RefreshingView. So obviously it
has trouble rendering Forms inside a RefreshingView repeater. Can't
work it out.

Any help will be much appreciated.

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



Re: Any RefreshingView-like repeater but with pagination?

2009-04-28 Thread Manuel Corrales
Have you tried DataView? I use DataView with an AjaxPaginator and it works
great.

On Tue, Apr 28, 2009 at 7:37 AM, HHB  wrote:

> Hey,
> Is there any repeater that has the features of RefreshingView but supports
> paginations?
> Thanks.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Any RefreshingView-like repeater but with pagination?

2009-04-28 Thread HHB
Hey,
Is there any repeater that has the features of RefreshingView but supports
paginations?
Thanks.


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



Re: RefreshingView/DataView with FormComponents and getForm

2009-01-29 Thread Igor Vaynberg
this is because you are using a refreshing view in combination with
form components.

in your case view items are removed from the refreshing view before
your filter runs, so you have a disconnect between

page->form->refresingview- | ->item->formcomponent

and so formcomponent.getform() cannot find the form.

what you should do is either set an item reuse strategy on the
refreshing view to prevent it from removing the view items or use a
form-friendly repeater - eg RepeatingView.

-igor

On Thu, Jan 29, 2009 at 11:50 AM, Ryan  wrote:
> I hacked together a quickstart and pasted the code here:
> http://pastebin.com/m3d0a54
>
> I didnt know if there was a policy on pasting code to the list..
>
> Thanks,
> Ryan
>
> On Thu, Jan 29, 2009 at 10:47:13AM -0800, Igor Vaynberg exclaimed:
>
>>show us your code
>>
>>-igor
>>
>>On Thu, Jan 29, 2009 at 10:36 AM, Ryan  wrote:
>>> I have a Panel with a DataView, inside populateItem I add TextFields to
>>> the Item (and the dataView is added to the Form).
>>>
>>> This panel contains a FeedbackPanel that should only show errors
>>> generated by fields added in populateItem. Unfortunately the Item object
>>> has its parent set to null. So calls to getParent on the TextFields
>>> looks like this:
>>>
>>> textField.getParent() -> item.getParent() -> null.
>>>
>>> This breaks the ContainerFeedbackMessageFilter and also breaks getForm()
>>> on the textfields (which throws a WicketRuntimeException because it
>>> cannot find the form).
>>>
>>>
>>> Is this the proper behavior? I was hoping item.getParent() would point
>>> to the dataView.
>>>
>>> Any ideas/pointers?
>>>
>>> Thanks!
>>> Ryan
>>>
>>> -
>>> 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
>
> -
> 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: RefreshingView/DataView with FormComponents and getForm

2009-01-29 Thread Ryan
I hacked together a quickstart and pasted the code here:
http://pastebin.com/m3d0a54

I didnt know if there was a policy on pasting code to the list..

Thanks,
Ryan 

On Thu, Jan 29, 2009 at 10:47:13AM -0800, Igor Vaynberg exclaimed:

>show us your code
>
>-igor
>
>On Thu, Jan 29, 2009 at 10:36 AM, Ryan  wrote:
>> I have a Panel with a DataView, inside populateItem I add TextFields to
>> the Item (and the dataView is added to the Form).
>>
>> This panel contains a FeedbackPanel that should only show errors
>> generated by fields added in populateItem. Unfortunately the Item object
>> has its parent set to null. So calls to getParent on the TextFields
>> looks like this:
>>
>> textField.getParent() -> item.getParent() -> null.
>>
>> This breaks the ContainerFeedbackMessageFilter and also breaks getForm()
>> on the textfields (which throws a WicketRuntimeException because it
>> cannot find the form).
>>
>>
>> Is this the proper behavior? I was hoping item.getParent() would point
>> to the dataView.
>>
>> Any ideas/pointers?
>>
>> Thanks!
>> Ryan
>>
>> -
>> 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

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



Re: RefreshingView/DataView with FormComponents and getForm

2009-01-29 Thread Igor Vaynberg
show us your code

-igor

On Thu, Jan 29, 2009 at 10:36 AM, Ryan  wrote:
> I have a Panel with a DataView, inside populateItem I add TextFields to
> the Item (and the dataView is added to the Form).
>
> This panel contains a FeedbackPanel that should only show errors
> generated by fields added in populateItem. Unfortunately the Item object
> has its parent set to null. So calls to getParent on the TextFields
> looks like this:
>
> textField.getParent() -> item.getParent() -> null.
>
> This breaks the ContainerFeedbackMessageFilter and also breaks getForm()
> on the textfields (which throws a WicketRuntimeException because it
> cannot find the form).
>
>
> Is this the proper behavior? I was hoping item.getParent() would point
> to the dataView.
>
> Any ideas/pointers?
>
> Thanks!
> Ryan
>
> -
> 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



RefreshingView/DataView with FormComponents and getForm

2009-01-29 Thread Ryan
I have a Panel with a DataView, inside populateItem I add TextFields to
the Item (and the dataView is added to the Form).

This panel contains a FeedbackPanel that should only show errors
generated by fields added in populateItem. Unfortunately the Item object
has its parent set to null. So calls to getParent on the TextFields
looks like this:

textField.getParent() -> item.getParent() -> null.

This breaks the ContainerFeedbackMessageFilter and also breaks getForm()
on the textfields (which throws a WicketRuntimeException because it
cannot find the form).


Is this the proper behavior? I was hoping item.getParent() would point
to the dataView.

Any ideas/pointers?

Thanks!
Ryan

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



Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

Never mind. I used SubmitLink instead of Link and that fixed it.
Thanks a lot Igor and others for your time and replies.

- krishna



krisnv wrote:
> 
> Ok. Should i need to call submitForm() on the event onClick() for the
> link?
> 
> add(new Link("edit") {
>public void onClick() {
>  int resultCode=0;
>  User usr = (User)getParent().getModelObject();
>  System.out.println("firstname=="+usr.getFirstName()); }
>});
>   }
> 
> -krishna
> 
> 
> igor.vaynberg wrote:
>> 
>> that is because your form never submits, otherwise you woudlve gotten
>> a stacktrace because you were using a readonlymodel previously
>> 
>> -igor
>> 
>> On Fri, Sep 26, 2008 at 9:43 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>
>>> I tried using the PropertyModel ,
>>>
>>> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>>>
>>> still not getting the new value.
>>>
>>> - krishna
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> equals seems ok, although your hashcode is broken
>>>>
>>>>
>>>> you do realize you are adding read only models to your
>>>> textfields...those models never update model objects.
>>>>
>>>> in fact you shouldve gotten a stack trace in your log indicating that
>>>> you cannot call setobject on a readonlymodel. if you do not see this i
>>>> am guessing your form never submits.
>>>>
>>>> the proper way to do this would be:
>>>>
>>>> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>>>>
>>>> -igor
>>>>
>>>> On Fri, Sep 26, 2008 at 9:14 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> Yes I think so. Below is my code :
>>>>>
>>>>> public boolean equals(final Object obj)
>>>>>{
>>>>>if (obj == this)
>>>>>{
>>>>>return true;
>>>>>}
>>>>>else if (obj == null)
>>>>>{
>>>>>return false;
>>>>>}
>>>>>else if (obj instanceof DetachableUserModel)
>>>>>{
>>>>>DetachableUserModel other =
>>>>> (DetachableUserModel)obj;
>>>>>return other.userId == this.userId;
>>>>>}
>>>>>return false;
>>>>>}
>>>>>
>>>>>public int hashCode() {
>>>>>return super.hashCode();
>>>>>}
>>>>>
>>>>> - krishna
>>>>>
>>>>>
>>>>> igor.vaynberg wrote:
>>>>>>
>>>>>> does your model properly implement equals and hashcode? and i mean
>>>>>> your actual IModel you are using, not the object inside it...
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]>
>>>>>> wrote:
>>>>>>>
>>>>>>> igor,
>>>>>>>
>>>>>>> I am already setting it . Do i have to provide any custom
>>>>>>> implementation?
>>>>>>>
>>>>>>> refreshingView.setItemReuseStrategy(new
>>>>>>> ReuseIfModelsEqualStrategy());
>>>>>>>
>>>>>>> -krishna
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> igor.vaynberg wrote:
>>>>>>>>
>>>>>>>> see IItemReuseStrategy
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Thanks for you reply and pointing to the right component to
>>>>>>>>> use.
>>>>>>>>> Just
>>>>>>>>> curious, is there any way to fix this to make it work using this
>>>>&

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

Ok. Should i need to call submitForm() on the event onClick() for the link?

add(new Link("edit") {
   public void onClick() {
 int resultCode=0;
 User usr = (User)getParent().getModelObject();
 System.out.println("firstname=="+usr.getFirstName()); }
   });
  }

-krishna


igor.vaynberg wrote:
> 
> that is because your form never submits, otherwise you woudlve gotten
> a stacktrace because you were using a readonlymodel previously
> 
> -igor
> 
> On Fri, Sep 26, 2008 at 9:43 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>
>> I tried using the PropertyModel ,
>>
>> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>>
>> still not getting the new value.
>>
>> - krishna
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> equals seems ok, although your hashcode is broken
>>>
>>>
>>> you do realize you are adding read only models to your
>>> textfields...those models never update model objects.
>>>
>>> in fact you shouldve gotten a stack trace in your log indicating that
>>> you cannot call setobject on a readonlymodel. if you do not see this i
>>> am guessing your form never submits.
>>>
>>> the proper way to do this would be:
>>>
>>> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>>>
>>> -igor
>>>
>>> On Fri, Sep 26, 2008 at 9:14 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>
>>>> Yes I think so. Below is my code :
>>>>
>>>> public boolean equals(final Object obj)
>>>>{
>>>>if (obj == this)
>>>>{
>>>>return true;
>>>>}
>>>>else if (obj == null)
>>>>{
>>>>return false;
>>>>}
>>>>else if (obj instanceof DetachableUserModel)
>>>>{
>>>>DetachableUserModel other =
>>>> (DetachableUserModel)obj;
>>>>return other.userId == this.userId;
>>>>}
>>>>return false;
>>>>}
>>>>
>>>>public int hashCode() {
>>>>return super.hashCode();
>>>>}
>>>>
>>>> - krishna
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>>
>>>>> does your model properly implement equals and hashcode? and i mean
>>>>> your actual IModel you are using, not the object inside it...
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>>
>>>>>> igor,
>>>>>>
>>>>>> I am already setting it . Do i have to provide any custom
>>>>>> implementation?
>>>>>>
>>>>>> refreshingView.setItemReuseStrategy(new
>>>>>> ReuseIfModelsEqualStrategy());
>>>>>>
>>>>>> -krishna
>>>>>>
>>>>>>
>>>>>>
>>>>>> igor.vaynberg wrote:
>>>>>>>
>>>>>>> see IItemReuseStrategy
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Thanks for you reply and pointing to the right component to use.
>>>>>>>> Just
>>>>>>>> curious, is there any way to fix this to make it work using this
>>>>>>>> approach?
>>>>>>>>
>>>>>>>> krishna
>>>>>>>>
>>>>>>>>
>>>>>>>> Matej Knopp-2 wrote:
>>>>>>>>>
>>>>>>>>> That's probably because refreshing view is creating new components
>>>>>>>>> on
>>>>>>>>> every request. Try using listView nad don't forget to call
>>>>>>>>> setReuseItems(true) on it.
>>>>>>>>>
>>>>>>>>> -Matej
>>&

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread Igor Vaynberg
that is because your form never submits, otherwise you woudlve gotten
a stacktrace because you were using a readonlymodel previously

-igor

On Fri, Sep 26, 2008 at 9:43 AM, krisnv <[EMAIL PROTECTED]> wrote:
>
> I tried using the PropertyModel ,
>
> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>
> still not getting the new value.
>
> - krishna
>
>
>
> igor.vaynberg wrote:
>>
>> equals seems ok, although your hashcode is broken
>>
>>
>> you do realize you are adding read only models to your
>> textfields...those models never update model objects.
>>
>> in fact you shouldve gotten a stack trace in your log indicating that
>> you cannot call setobject on a readonlymodel. if you do not see this i
>> am guessing your form never submits.
>>
>> the proper way to do this would be:
>>
>> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
>>
>> -igor
>>
>> On Fri, Sep 26, 2008 at 9:14 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>
>>> Yes I think so. Below is my code :
>>>
>>> public boolean equals(final Object obj)
>>>{
>>>if (obj == this)
>>>{
>>>return true;
>>>}
>>>else if (obj == null)
>>>{
>>>return false;
>>>}
>>>else if (obj instanceof DetachableUserModel)
>>>{
>>>DetachableUserModel other = (DetachableUserModel)obj;
>>>return other.userId == this.userId;
>>>}
>>>return false;
>>>}
>>>
>>>public int hashCode() {
>>>return super.hashCode();
>>>}
>>>
>>> - krishna
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> does your model properly implement equals and hashcode? and i mean
>>>> your actual IModel you are using, not the object inside it...
>>>>
>>>> -igor
>>>>
>>>> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> igor,
>>>>>
>>>>> I am already setting it . Do i have to provide any custom
>>>>> implementation?
>>>>>
>>>>> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>>>>>
>>>>> -krishna
>>>>>
>>>>>
>>>>>
>>>>> igor.vaynberg wrote:
>>>>>>
>>>>>> see IItemReuseStrategy
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]>
>>>>>> wrote:
>>>>>>>
>>>>>>> Thanks for you reply and pointing to the right component to use.
>>>>>>> Just
>>>>>>> curious, is there any way to fix this to make it work using this
>>>>>>> approach?
>>>>>>>
>>>>>>> krishna
>>>>>>>
>>>>>>>
>>>>>>> Matej Knopp-2 wrote:
>>>>>>>>
>>>>>>>> That's probably because refreshing view is creating new components
>>>>>>>> on
>>>>>>>> every request. Try using listView nad don't forget to call
>>>>>>>> setReuseItems(true) on it.
>>>>>>>>
>>>>>>>> -Matej
>>>>>>>>
>>>>>>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> can any of you please respond.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> krisnv wrote:
>>>>>>>>>>
>>>>>>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>>>>>>> Examples.
>>>>>>>>>>  I added a Panel and TextFields to this RefreshingView. I
>>>>>>>>>> populate
>>>>>>>>>> these TextFields from a list from Database and have assigned Model
&g

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

I tried using the PropertyModel , 

add(new textfield("name", new propertymodel(item.getmodel(), "name"));

still not getting the new value.

- krishna



igor.vaynberg wrote:
> 
> equals seems ok, although your hashcode is broken
> 
> 
> you do realize you are adding read only models to your
> textfields...those models never update model objects.
> 
> in fact you shouldve gotten a stack trace in your log indicating that
> you cannot call setobject on a readonlymodel. if you do not see this i
> am guessing your form never submits.
> 
> the proper way to do this would be:
> 
> add(new textfield("name", new propertymodel(item.getmodel(), "name"));
> 
> -igor
> 
> On Fri, Sep 26, 2008 at 9:14 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>
>> Yes I think so. Below is my code :
>>
>> public boolean equals(final Object obj)
>>{
>>if (obj == this)
>>{
>>return true;
>>}
>>else if (obj == null)
>>{
>>return false;
>>}
>>else if (obj instanceof DetachableUserModel)
>>{
>>DetachableUserModel other = (DetachableUserModel)obj;
>>return other.userId == this.userId;
>>}
>>return false;
>>}
>>
>>public int hashCode() {
>>return super.hashCode();
>>}
>>
>> - krishna
>>
>>
>> igor.vaynberg wrote:
>>>
>>> does your model properly implement equals and hashcode? and i mean
>>> your actual IModel you are using, not the object inside it...
>>>
>>> -igor
>>>
>>> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>
>>>> igor,
>>>>
>>>> I am already setting it . Do i have to provide any custom
>>>> implementation?
>>>>
>>>> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>>>>
>>>> -krishna
>>>>
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>>
>>>>> see IItemReuseStrategy
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>>
>>>>>> Thanks for you reply and pointing to the right component to use.
>>>>>> Just
>>>>>> curious, is there any way to fix this to make it work using this
>>>>>> approach?
>>>>>>
>>>>>> krishna
>>>>>>
>>>>>>
>>>>>> Matej Knopp-2 wrote:
>>>>>>>
>>>>>>> That's probably because refreshing view is creating new components
>>>>>>> on
>>>>>>> every request. Try using listView nad don't forget to call
>>>>>>> setReuseItems(true) on it.
>>>>>>>
>>>>>>> -Matej
>>>>>>>
>>>>>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> can any of you please respond.
>>>>>>>>
>>>>>>>>
>>>>>>>> krisnv wrote:
>>>>>>>>>
>>>>>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>>>>>> Examples.
>>>>>>>>>  I added a Panel and TextFields to this RefreshingView. I
>>>>>>>>> populate
>>>>>>>>> these TextFields from a list from Database and have assigned Model
>>>>>>>>> objects
>>>>>>>>> to each TextField component. The problem is when user modifies a
>>>>>>>>> value
>>>>>>>>> in
>>>>>>>>> any of the text fields, i still get old value from the original
>>>>>>>>> list.
>>>>>>>>> Model is not getting updated to reflect new value entered by the
>>>>>>>>> use.
>>>>>>>>> Here
>>>>>>>>> is the code:
>>>>>>>>> 
>>>>>>

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread Igor Vaynberg
equals seems ok, although your hashcode is broken


you do realize you are adding read only models to your
textfields...those models never update model objects.

in fact you shouldve gotten a stack trace in your log indicating that
you cannot call setobject on a readonlymodel. if you do not see this i
am guessing your form never submits.

the proper way to do this would be:

add(new textfield("name", new propertymodel(item.getmodel(), "name"));

-igor

On Fri, Sep 26, 2008 at 9:14 AM, krisnv <[EMAIL PROTECTED]> wrote:
>
> Yes I think so. Below is my code :
>
> public boolean equals(final Object obj)
>{
>if (obj == this)
>{
>return true;
>}
>else if (obj == null)
>{
>return false;
>}
>else if (obj instanceof DetachableUserModel)
>{
>DetachableUserModel other = (DetachableUserModel)obj;
>return other.userId == this.userId;
>}
>return false;
>}
>
>public int hashCode() {
>return super.hashCode();
>}
>
> - krishna
>
>
> igor.vaynberg wrote:
>>
>> does your model properly implement equals and hashcode? and i mean
>> your actual IModel you are using, not the object inside it...
>>
>> -igor
>>
>> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>
>>> igor,
>>>
>>> I am already setting it . Do i have to provide any custom implementation?
>>>
>>> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>>>
>>> -krishna
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> see IItemReuseStrategy
>>>>
>>>> -igor
>>>>
>>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> Thanks for you reply and pointing to the right component to use.
>>>>> Just
>>>>> curious, is there any way to fix this to make it work using this
>>>>> approach?
>>>>>
>>>>> krishna
>>>>>
>>>>>
>>>>> Matej Knopp-2 wrote:
>>>>>>
>>>>>> That's probably because refreshing view is creating new components on
>>>>>> every request. Try using listView nad don't forget to call
>>>>>> setReuseItems(true) on it.
>>>>>>
>>>>>> -Matej
>>>>>>
>>>>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]>
>>>>>> wrote:
>>>>>>>
>>>>>>> can any of you please respond.
>>>>>>>
>>>>>>>
>>>>>>> krisnv wrote:
>>>>>>>>
>>>>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>>>>> Examples.
>>>>>>>>  I added a Panel and TextFields to this RefreshingView. I
>>>>>>>> populate
>>>>>>>> these TextFields from a list from Database and have assigned Model
>>>>>>>> objects
>>>>>>>> to each TextField component. The problem is when user modifies a
>>>>>>>> value
>>>>>>>> in
>>>>>>>> any of the text fields, i still get old value from the original
>>>>>>>> list.
>>>>>>>> Model is not getting updated to reflect new value entered by the
>>>>>>>> use.
>>>>>>>> Here
>>>>>>>> is the code:
>>>>>>>> 
>>>>>>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>>>>>>> protected Iterator getItemModels() {  return new
>>>>>>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>>>>>>> object) { return new DetachableUserModel((User)object);
>>>>>>>> }
>>>>>>>> };
>>>>>>>> } protected void populateItem(final Item item) { //
>>>>>>>> populate
>>>>>>>> the row of the repeater IModel user = item.getModel();
>>>>>>>> item.add(new ActionPanel("actions",
>>>>>>>&

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

Yes I think so. Below is my code :

public boolean equals(final Object obj)
{
if (obj == this)
{
return true;
}
else if (obj == null)
{
return false;
}
else if (obj instanceof DetachableUserModel)
{
DetachableUserModel other = (DetachableUserModel)obj;
return other.userId == this.userId;
}
return false;
}

public int hashCode() {
return super.hashCode();
}

- krishna


igor.vaynberg wrote:
> 
> does your model properly implement equals and hashcode? and i mean
> your actual IModel you are using, not the object inside it...
> 
> -igor
> 
> On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>
>> igor,
>>
>> I am already setting it . Do i have to provide any custom implementation?
>>
>> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>>
>> -krishna
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> see IItemReuseStrategy
>>>
>>> -igor
>>>
>>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>
>>>> Thanks for you reply and pointing to the right component to use.
>>>> Just
>>>> curious, is there any way to fix this to make it work using this
>>>> approach?
>>>>
>>>> krishna
>>>>
>>>>
>>>> Matej Knopp-2 wrote:
>>>>>
>>>>> That's probably because refreshing view is creating new components on
>>>>> every request. Try using listView nad don't forget to call
>>>>> setReuseItems(true) on it.
>>>>>
>>>>> -Matej
>>>>>
>>>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>>
>>>>>> can any of you please respond.
>>>>>>
>>>>>>
>>>>>> krisnv wrote:
>>>>>>>
>>>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>>>> Examples.
>>>>>>>  I added a Panel and TextFields to this RefreshingView. I
>>>>>>> populate
>>>>>>> these TextFields from a list from Database and have assigned Model
>>>>>>> objects
>>>>>>> to each TextField component. The problem is when user modifies a
>>>>>>> value
>>>>>>> in
>>>>>>> any of the text fields, i still get old value from the original
>>>>>>> list.
>>>>>>> Model is not getting updated to reflect new value entered by the
>>>>>>> use.
>>>>>>> Here
>>>>>>> is the code:
>>>>>>> 
>>>>>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>>>>>> protected Iterator getItemModels() {  return new
>>>>>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>>>>>> object) { return new DetachableUserModel((User)object);
>>>>>>> }
>>>>>>> };
>>>>>>> } protected void populateItem(final Item item) { //
>>>>>>> populate
>>>>>>> the row of the repeater IModel user = item.getModel();
>>>>>>> item.add(new ActionPanel("actions",
>>>>>>> item.getModel()).setOutputMarkupId(true)); item.add(new
>>>>>>> TextField("UserName", new AbstractReadOnlyModel() { public
>>>>>>> Object
>>>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>>>> ur.getUserName(); } })); item.add(new
>>>>>>> TextField("FirstName", new AbstractReadOnlyModel() { public
>>>>>>> Object
>>>>>>> getObject() { User ur = (User)item.getModelObject();
>>>>>>> return
>>>>>>> ur.getFirstName(); } })); item.add(new
>>>>>>> TextField("LastName", new AbstractReadOnlyModel() { public
>>>>>>> Object
>>>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>>>> ur.getLastName(); } })); item.add(new
>>>>>&g

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread Igor Vaynberg
does your model properly implement equals and hashcode? and i mean
your actual IModel you are using, not the object inside it...

-igor

On Fri, Sep 26, 2008 at 8:55 AM, krisnv <[EMAIL PROTECTED]> wrote:
>
> igor,
>
> I am already setting it . Do i have to provide any custom implementation?
>
> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>
> -krishna
>
>
>
> igor.vaynberg wrote:
>>
>> see IItemReuseStrategy
>>
>> -igor
>>
>> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>>
>>> Thanks for you reply and pointing to the right component to use. Just
>>> curious, is there any way to fix this to make it work using this
>>> approach?
>>>
>>> krishna
>>>
>>>
>>> Matej Knopp-2 wrote:
>>>>
>>>> That's probably because refreshing view is creating new components on
>>>> every request. Try using listView nad don't forget to call
>>>> setReuseItems(true) on it.
>>>>
>>>> -Matej
>>>>
>>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> can any of you please respond.
>>>>>
>>>>>
>>>>> krisnv wrote:
>>>>>>
>>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>>> Examples.
>>>>>>  I added a Panel and TextFields to this RefreshingView. I populate
>>>>>> these TextFields from a list from Database and have assigned Model
>>>>>> objects
>>>>>> to each TextField component. The problem is when user modifies a value
>>>>>> in
>>>>>> any of the text fields, i still get old value from the original list.
>>>>>> Model is not getting updated to reflect new value entered by the use.
>>>>>> Here
>>>>>> is the code:
>>>>>> 
>>>>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>>>>> protected Iterator getItemModels() {  return new
>>>>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>>>>> object) { return new DetachableUserModel((User)object); }
>>>>>> };
>>>>>> } protected void populateItem(final Item item) { //
>>>>>> populate
>>>>>> the row of the repeater IModel user = item.getModel();
>>>>>> item.add(new ActionPanel("actions",
>>>>>> item.getModel()).setOutputMarkupId(true)); item.add(new
>>>>>> TextField("UserName", new AbstractReadOnlyModel() { public
>>>>>> Object
>>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>>> ur.getUserName(); } })); item.add(new
>>>>>> TextField("FirstName", new AbstractReadOnlyModel() { public
>>>>>> Object
>>>>>> getObject() { User ur = (User)item.getModelObject();
>>>>>> return
>>>>>> ur.getFirstName(); } })); item.add(new
>>>>>> TextField("LastName", new AbstractReadOnlyModel() { public Object
>>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>>> ur.getLastName(); } })); item.add(new
>>>>>> TextField("ContactPhone", new AbstractReadOnlyModel() { public
>>>>>> Object
>>>>>> getObject() { User ur = (User)item.getModelObject();
>>>>>> return
>>>>>> ur.getPhone(); } })); item.add(new TextField("Email", new
>>>>>> AbstractReadOnlyModel() { public Object getObject()
>>>>>> {   User ur = (User)item.getModelObject();
>>>>>>   return ur.getEmail(); } }));
>>>>>> item.add(new PasswordTextField("Password", new
>>>>>> AbstractReadOnlyModel()
>>>>>> { public Object getObject() { User ur =
>>>>>> (User)item.getModelObject();   return ur.getPassword(); }
>>>>>> })); } protected Item newItem(String id, int index,
>>>>>> IModel
>>>>>> model) { // this item sets markup class attribute to either
>>>>>> 'odd'
>>>>>> or // 'even' for decoration return new OddEvenItem(id, index,
>>>>>> model);
>>>>>> } }; refreshingView.setOutputMarkupId(true);
>

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

igor,

I am already setting it . Do i have to provide any custom implementation?

refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());

-krishna



igor.vaynberg wrote:
> 
> see IItemReuseStrategy
> 
> -igor
> 
> On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]> wrote:
>>
>> Thanks for you reply and pointing to the right component to use. Just
>> curious, is there any way to fix this to make it work using this
>> approach?
>>
>> krishna
>>
>>
>> Matej Knopp-2 wrote:
>>>
>>> That's probably because refreshing view is creating new components on
>>> every request. Try using listView nad don't forget to call
>>> setReuseItems(true) on it.
>>>
>>> -Matej
>>>
>>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]> wrote:
>>>>
>>>> can any of you please respond.
>>>>
>>>>
>>>> krisnv wrote:
>>>>>
>>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>>> Examples.
>>>>>  I added a Panel and TextFields to this RefreshingView. I populate
>>>>> these TextFields from a list from Database and have assigned Model
>>>>> objects
>>>>> to each TextField component. The problem is when user modifies a value
>>>>> in
>>>>> any of the text fields, i still get old value from the original list.
>>>>> Model is not getting updated to reflect new value entered by the use.
>>>>> Here
>>>>> is the code:
>>>>> 
>>>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>>>> protected Iterator getItemModels() {  return new
>>>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>>>> object) { return new DetachableUserModel((User)object); }
>>>>> };
>>>>> } protected void populateItem(final Item item) { //
>>>>> populate
>>>>> the row of the repeater IModel user = item.getModel();
>>>>> item.add(new ActionPanel("actions",
>>>>> item.getModel()).setOutputMarkupId(true)); item.add(new
>>>>> TextField("UserName", new AbstractReadOnlyModel() { public
>>>>> Object
>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>> ur.getUserName(); } })); item.add(new
>>>>> TextField("FirstName", new AbstractReadOnlyModel() { public
>>>>> Object
>>>>> getObject() { User ur = (User)item.getModelObject();
>>>>> return
>>>>> ur.getFirstName(); } })); item.add(new
>>>>> TextField("LastName", new AbstractReadOnlyModel() { public Object
>>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>>> ur.getLastName(); } })); item.add(new
>>>>> TextField("ContactPhone", new AbstractReadOnlyModel() { public
>>>>> Object
>>>>> getObject() { User ur = (User)item.getModelObject();
>>>>> return
>>>>> ur.getPhone(); } })); item.add(new TextField("Email", new
>>>>> AbstractReadOnlyModel() { public Object getObject()
>>>>> {   User ur = (User)item.getModelObject();
>>>>>   return ur.getEmail(); } }));
>>>>> item.add(new PasswordTextField("Password", new
>>>>> AbstractReadOnlyModel()
>>>>> { public Object getObject() { User ur =
>>>>> (User)item.getModelObject();   return ur.getPassword(); }
>>>>> })); } protected Item newItem(String id, int index,
>>>>> IModel
>>>>> model) { // this item sets markup class attribute to either
>>>>> 'odd'
>>>>> or // 'even' for decoration return new OddEvenItem(id, index,
>>>>> model);
>>>>> } }; refreshingView.setOutputMarkupId(true);
>>>>> refreshingView.setItemReuseStrategy(new
>>>>> ReuseIfModelsEqualStrategy());
>>>>> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
>>>>> form.add(refreshingView); }
>>>>> 
>>>>> Here is the code for the Panel. I am trying to print the value from
>>>>> the
>>>>> text field but still getting old value. private class ActionPanel
>>>>> extends Panel
>>>>> {  public ActionPanel(String id, IModel model) {
>

Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread Igor Vaynberg
see IItemReuseStrategy

-igor

On Fri, Sep 26, 2008 at 8:41 AM, krisnv <[EMAIL PROTECTED]> wrote:
>
> Thanks for you reply and pointing to the right component to use. Just
> curious, is there any way to fix this to make it work using this
> approach?
>
> krishna
>
>
> Matej Knopp-2 wrote:
>>
>> That's probably because refreshing view is creating new components on
>> every request. Try using listView nad don't forget to call
>> setReuseItems(true) on it.
>>
>> -Matej
>>
>> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]> wrote:
>>>
>>> can any of you please respond.
>>>
>>>
>>> krisnv wrote:
>>>>
>>>> I have RefreshingView similar to Contact Editor in Wicket
>>>> Examples.
>>>>  I added a Panel and TextFields to this RefreshingView. I populate
>>>> these TextFields from a list from Database and have assigned Model
>>>> objects
>>>> to each TextField component. The problem is when user modifies a value
>>>> in
>>>> any of the text fields, i still get old value from the original list.
>>>> Model is not getting updated to reflect new value entered by the use.
>>>> Here
>>>> is the code:
>>>> 
>>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>>> protected Iterator getItemModels() {  return new
>>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>>> object) { return new DetachableUserModel((User)object); } };
>>>> } protected void populateItem(final Item item) { // populate
>>>> the row of the repeater IModel user = item.getModel();
>>>> item.add(new ActionPanel("actions",
>>>> item.getModel()).setOutputMarkupId(true)); item.add(new
>>>> TextField("UserName", new AbstractReadOnlyModel() { public
>>>> Object
>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>> ur.getUserName(); } })); item.add(new
>>>> TextField("FirstName", new AbstractReadOnlyModel() { public
>>>> Object
>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>> ur.getFirstName(); } })); item.add(new
>>>> TextField("LastName", new AbstractReadOnlyModel() { public Object
>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>> ur.getLastName(); } })); item.add(new
>>>> TextField("ContactPhone", new AbstractReadOnlyModel() { public
>>>> Object
>>>> getObject() { User ur = (User)item.getModelObject(); return
>>>> ur.getPhone(); } })); item.add(new TextField("Email", new
>>>> AbstractReadOnlyModel() { public Object getObject()
>>>> {   User ur = (User)item.getModelObject();
>>>>   return ur.getEmail(); } }));
>>>> item.add(new PasswordTextField("Password", new
>>>> AbstractReadOnlyModel()
>>>> { public Object getObject() { User ur =
>>>> (User)item.getModelObject();   return ur.getPassword(); }
>>>> })); } protected Item newItem(String id, int index,
>>>> IModel
>>>> model) { // this item sets markup class attribute to either
>>>> 'odd'
>>>> or // 'even' for decoration return new OddEvenItem(id, index,
>>>> model);
>>>> } }; refreshingView.setOutputMarkupId(true);
>>>> refreshingView.setItemReuseStrategy(new
>>>> ReuseIfModelsEqualStrategy());
>>>> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
>>>> form.add(refreshingView); }
>>>> 
>>>> Here is the code for the Panel. I am trying to print the value from the
>>>> text field but still getting old value. private class ActionPanel
>>>> extends Panel
>>>> {  public ActionPanel(String id, IModel model) {
>>>> super(id, model);  add(new Link("edit") { public void
>>>> onClick() { int resultCode=0; User usr =
>>>> (User)getParent().getModelObject();
>>>> System.out.println("firstname=="+usr.getFirstName());  }
>>>> }); }
>>>> Any help would be appreciated. Thanks, krishna
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19689965.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19691024.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

Thanks for you reply and pointing to the right component to use. Just
curious, is there any way to fix this to make it work using this
approach?

krishna


Matej Knopp-2 wrote:
> 
> That's probably because refreshing view is creating new components on
> every request. Try using listView nad don't forget to call
> setReuseItems(true) on it.
> 
> -Matej
> 
> On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]> wrote:
>>
>> can any of you please respond.
>>
>>
>> krisnv wrote:
>>>
>>> I have RefreshingView similar to Contact Editor in Wicket
>>> Examples.
>>>  I added a Panel and TextFields to this RefreshingView. I populate
>>> these TextFields from a list from Database and have assigned Model
>>> objects
>>> to each TextField component. The problem is when user modifies a value
>>> in
>>> any of the text fields, i still get old value from the original list.
>>> Model is not getting updated to reflect new value entered by the use.
>>> Here
>>> is the code:
>>> 
>>> RefreshingView refreshingView = new RefreshingView("simple") { 
>>> protected Iterator getItemModels() {  return new
>>> ModelIteratorAdapter(users) { protected IModel model(Object
>>> object) { return new DetachableUserModel((User)object); } };
>>> } protected void populateItem(final Item item) { // populate
>>> the row of the repeater IModel user = item.getModel();
>>> item.add(new ActionPanel("actions",
>>> item.getModel()).setOutputMarkupId(true)); item.add(new
>>> TextField("UserName", new AbstractReadOnlyModel() { public
>>> Object
>>> getObject() { User ur = (User)item.getModelObject(); return
>>> ur.getUserName(); } })); item.add(new
>>> TextField("FirstName", new AbstractReadOnlyModel() { public
>>> Object
>>> getObject() { User ur = (User)item.getModelObject(); return
>>> ur.getFirstName(); } })); item.add(new
>>> TextField("LastName", new AbstractReadOnlyModel() { public Object
>>> getObject() { User ur = (User)item.getModelObject(); return
>>> ur.getLastName(); } })); item.add(new
>>> TextField("ContactPhone", new AbstractReadOnlyModel() { public
>>> Object
>>> getObject() { User ur = (User)item.getModelObject(); return
>>> ur.getPhone(); } })); item.add(new TextField("Email", new
>>> AbstractReadOnlyModel() { public Object getObject()
>>> {   User ur = (User)item.getModelObject();
>>>   return ur.getEmail(); } }));
>>> item.add(new PasswordTextField("Password", new
>>> AbstractReadOnlyModel()
>>> { public Object getObject() { User ur =
>>> (User)item.getModelObject();   return ur.getPassword(); }
>>> })); } protected Item newItem(String id, int index,
>>> IModel
>>> model) { // this item sets markup class attribute to either
>>> 'odd'
>>> or // 'even' for decoration return new OddEvenItem(id, index,
>>> model);
>>> } }; refreshingView.setOutputMarkupId(true);
>>> refreshingView.setItemReuseStrategy(new
>>> ReuseIfModelsEqualStrategy());
>>> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
>>> form.add(refreshingView); }
>>> 
>>> Here is the code for the Panel. I am trying to print the value from the
>>> text field but still getting old value. private class ActionPanel
>>> extends Panel
>>> {  public ActionPanel(String id, IModel model) {
>>> super(id, model);  add(new Link("edit") { public void
>>> onClick() { int resultCode=0; User usr =
>>> (User)getParent().getModelObject();
>>> System.out.println("firstname=="+usr.getFirstName());  }
>>> }); }
>>> Any help would be appreciated. Thanks, krishna
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19689965.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19691024.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread Matej Knopp
That's probably because refreshing view is creating new components on
every request. Try using listView nad don't forget to call
setReuseItems(true) on it.

-Matej

On Fri, Sep 26, 2008 at 4:49 PM, krisnv <[EMAIL PROTECTED]> wrote:
>
> can any of you please respond.
>
>
> krisnv wrote:
>>
>> I have RefreshingView similar to Contact Editor in Wicket Examples.
>>  I added a Panel and TextFields to this RefreshingView. I populate
>> these TextFields from a list from Database and have assigned Model objects
>> to each TextField component. The problem is when user modifies a value in
>> any of the text fields, i still get old value from the original list.
>> Model is not getting updated to reflect new value entered by the use. Here
>> is the code:
>> 
>> RefreshingView refreshingView = new RefreshingView("simple") { 
>> protected Iterator getItemModels() {  return new
>> ModelIteratorAdapter(users) { protected IModel model(Object
>> object) { return new DetachableUserModel((User)object); } };
>> } protected void populateItem(final Item item) { // populate
>> the row of the repeater IModel user = item.getModel();
>> item.add(new ActionPanel("actions",
>> item.getModel()).setOutputMarkupId(true)); item.add(new
>> TextField("UserName", new AbstractReadOnlyModel() { public Object
>> getObject() { User ur = (User)item.getModelObject(); return
>> ur.getUserName(); } })); item.add(new
>> TextField("FirstName", new AbstractReadOnlyModel() { public Object
>> getObject() { User ur = (User)item.getModelObject(); return
>> ur.getFirstName(); } })); item.add(new
>> TextField("LastName", new AbstractReadOnlyModel() { public Object
>> getObject() { User ur = (User)item.getModelObject(); return
>> ur.getLastName(); } })); item.add(new
>> TextField("ContactPhone", new AbstractReadOnlyModel() { public Object
>> getObject() { User ur = (User)item.getModelObject(); return
>> ur.getPhone(); } })); item.add(new TextField("Email", new
>> AbstractReadOnlyModel() { public Object getObject()
>> {   User ur = (User)item.getModelObject();
>>   return ur.getEmail(); } }));
>> item.add(new PasswordTextField("Password", new AbstractReadOnlyModel()
>> { public Object getObject() { User ur =
>> (User)item.getModelObject();   return ur.getPassword(); }
>> })); } protected Item newItem(String id, int index, IModel
>> model) { // this item sets markup class attribute to either 'odd'
>> or // 'even' for decoration return new OddEvenItem(id, index, model);
>> } }; refreshingView.setOutputMarkupId(true);
>> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
>> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
>> form.add(refreshingView); }
>> 
>> Here is the code for the Panel. I am trying to print the value from the
>> text field but still getting old value. private class ActionPanel
>> extends Panel
>> {  public ActionPanel(String id, IModel model) {
>> super(id, model);  add(new Link("edit") { public void
>> onClick() { int resultCode=0; User usr =
>> (User)getParent().getModelObject();
>> System.out.println("firstname=="+usr.getFirstName());  }
>> }); }
>> Any help would be appreciated. Thanks, krishna
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19689965.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Model object not geeting updated inside a RefreshingView

2008-09-26 Thread krisnv

can any of you please respond.


krisnv wrote:
> 
> I have RefreshingView similar to Contact Editor in Wicket Examples.
>  I added a Panel and TextFields to this RefreshingView. I populate
> these TextFields from a list from Database and have assigned Model objects
> to each TextField component. The problem is when user modifies a value in
> any of the text fields, i still get old value from the original list.
> Model is not getting updated to reflect new value entered by the use. Here
> is the code:
> 
> RefreshingView refreshingView = new RefreshingView("simple") { 
> protected Iterator getItemModels() {  return new
> ModelIteratorAdapter(users) { protected IModel model(Object
> object) { return new DetachableUserModel((User)object); } };
> } protected void populateItem(final Item item) { // populate
> the row of the repeater IModel user = item.getModel();
> item.add(new ActionPanel("actions",
> item.getModel()).setOutputMarkupId(true)); item.add(new
> TextField("UserName", new AbstractReadOnlyModel() { public Object
> getObject() { User ur = (User)item.getModelObject(); return
> ur.getUserName(); } })); item.add(new
> TextField("FirstName", new AbstractReadOnlyModel() { public Object
> getObject() { User ur = (User)item.getModelObject(); return
> ur.getFirstName(); } })); item.add(new
> TextField("LastName", new AbstractReadOnlyModel() { public Object
> getObject() { User ur = (User)item.getModelObject(); return
> ur.getLastName(); } })); item.add(new
> TextField("ContactPhone", new AbstractReadOnlyModel() { public Object
> getObject() { User ur = (User)item.getModelObject(); return
> ur.getPhone(); } })); item.add(new TextField("Email", new
> AbstractReadOnlyModel() { public Object getObject()
> {   User ur = (User)item.getModelObject();
>   return ur.getEmail(); } }));
> item.add(new PasswordTextField("Password", new AbstractReadOnlyModel()
> { public Object getObject() {     User ur =
> (User)item.getModelObject();   return ur.getPassword(); }
> })); } protected Item newItem(String id, int index, IModel
> model) { // this item sets markup class attribute to either 'odd'
> or // 'even' for decoration return new OddEvenItem(id, index, model);
> } }; refreshingView.setOutputMarkupId(true);
> refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
> refreshingView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
> form.add(refreshingView); }
> 
> Here is the code for the Panel. I am trying to print the value from the
> text field but still getting old value. private class ActionPanel
> extends Panel 
> {  public ActionPanel(String id, IModel model) {
> super(id, model);  add(new Link("edit") { public void
> onClick() { int resultCode=0; User usr =
> (User)getParent().getModelObject();
> System.out.println("firstname=="+usr.getFirstName());  }
> }); }
> Any help would be appreciated. Thanks, krishna
>
> 

-- 
View this message in context: 
http://www.nabble.com/Model-object-not-geeting-updated-inside-a-RefreshingView-tp19688544p19689965.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RefreshingView how to resize it?

2008-07-28 Thread Fabien D.

I found the solution, by reducing the size of the input text inside the
refreshingview.
-- 
View this message in context: 
http://www.nabble.com/RefreshingView-how-to-resize-it--tp18688971p18689155.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RefreshingView how to resize it?

2008-07-28 Thread Fabien D.

Hi everybody,


I'm using a RefreshingView inside a table. This table is to long, and i
would like to reduce the width. I try to do this with the css, fail!

***


Id
Email *
Nom de passe *
Nom
Prénom
Droit d'accès










*
In my css : 
.refreshingTable{
width: 300px;
}
*

So if someone has already succeded, can help me?

Thank you in advance
-- 
View this message in context: 
http://www.nabble.com/RefreshingView-how-to-resize-it--tp18688971p18688971.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with error message and refreshingView

2008-06-19 Thread Fabien D.

I find a solution but I supose that it's not the best. I  put between the
"simple" and the "name" the Id of the row  (the number of rows of my
refreshingView is not fixed :( )

form.simple.1.name.Required = 


-- 
View this message in context: 
http://www.nabble.com/Problem-with-error-message-and-refreshingView-tp18005178p18008324.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with error message and refreshingView

2008-06-19 Thread Fabien D.

Hi evreybody,

I 'm finalising my refreshingView, in ma web application for managing user.

-> my form (wicket id "form")
 |-> my refreshingView (wicket id "simple)
|-> Textfield (wicket id "name")

For example, if I set required my textfield, and I want to customize to
display message in a properties file, How can i do?

I have try :
form.simple.name.Required = 
form.name.Required = 
simple.name.Required =   

And nothing is working.


Thank you for your help.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-error-message-and-refreshingView-tp18005178p18005178.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: refreshingview with textfield items that use validatior

2008-05-22 Thread Igor Vaynberg
if you use reuseifmodelequalsstrategy then you need to implement
equals/hashcode on the models you give to refreshingview

-igor

On Thu, May 22, 2008 at 11:40 AM, i ii <[EMAIL PROTECTED]> wrote:
>
> i cannot get to work :(
>
>> From: [EMAIL PROTECTED]
>> To: users@wicket.apache.org
>> Subject: RE: refreshingview with textfield items that use validatior
>> Date: Thu, 22 May 2008 15:47:52 +
>>
>>
>> thank you for help, but all i find is 
>> org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy and 
>> org.apache.wicket.markup.repeater.DefaultItemReuseStrategy. neither work, 
>> need to implement org.apache.wicket.markup.repeater.IItemReuseStrategy?
>>
>> > Date: Thu, 22 May 2008 08:22:41 -0700
>> > From: [EMAIL PROTECTED]
>> > To: users@wicket.apache.org
>> > Subject: Re: refreshingview with textfield items that use validatior
>> >
>> > see setitemreusestrategy, there is also an example in
>> > wicketstuff.org/wicket13/repeater
>> >
>> > -igor
>> >
>> >
>> > On Thu, May 22, 2008 at 5:43 AM, i ii <[EMAIL PROTECTED]> wrote:
>> > >
>> > > how can use refreshingview with textfield items that use validatior? 
>> > > when i use and validator fails all textfield values reset. i want reset 
>> > > every request, but not when validator fails.
>> > > -
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: refreshingview with textfield items that use validatior

2008-05-22 Thread i ii

i cannot get to work :(

> From: [EMAIL PROTECTED]
> To: users@wicket.apache.org
> Subject: RE: refreshingview with textfield items that use validatior
> Date: Thu, 22 May 2008 15:47:52 +
> 
> 
> thank you for help, but all i find is 
> org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy and 
> org.apache.wicket.markup.repeater.DefaultItemReuseStrategy. neither work, 
> need to implement org.apache.wicket.markup.repeater.IItemReuseStrategy?
> 
> > Date: Thu, 22 May 2008 08:22:41 -0700
> > From: [EMAIL PROTECTED]
> > To: users@wicket.apache.org
> > Subject: Re: refreshingview with textfield items that use validatior
> > 
> > see setitemreusestrategy, there is also an example in
> > wicketstuff.org/wicket13/repeater
> > 
> > -igor
> > 
> > 
> > On Thu, May 22, 2008 at 5:43 AM, i ii <[EMAIL PROTECTED]> wrote:
> > >
> > > how can use refreshingview with textfield items that use validatior? when 
> > > i use and validator fails all textfield values reset. i want reset every 
> > > request, but not when validator fails.
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 


RE: refreshingview with textfield items that use validatior

2008-05-22 Thread i ii

thank you for help, but all i find is 
org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy and 
org.apache.wicket.markup.repeater.DefaultItemReuseStrategy. neither work, need 
to implement org.apache.wicket.markup.repeater.IItemReuseStrategy?

> Date: Thu, 22 May 2008 08:22:41 -0700
> From: [EMAIL PROTECTED]
> To: users@wicket.apache.org
> Subject: Re: refreshingview with textfield items that use validatior
> 
> see setitemreusestrategy, there is also an example in
> wicketstuff.org/wicket13/repeater
> 
> -igor
> 
> 
> On Thu, May 22, 2008 at 5:43 AM, i ii <[EMAIL PROTECTED]> wrote:
> >
> > how can use refreshingview with textfield items that use validatior? when i 
> > use and validator fails all textfield values reset. i want reset every 
> > request, but not when validator fails.
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


Re: refreshingview with textfield items that use validatior

2008-05-22 Thread Igor Vaynberg
see setitemreusestrategy, there is also an example in
wicketstuff.org/wicket13/repeater

-igor


On Thu, May 22, 2008 at 5:43 AM, i ii <[EMAIL PROTECTED]> wrote:
>
> how can use refreshingview with textfield items that use validatior? when i 
> use and validator fails all textfield values reset. i want reset every 
> request, but not when validator fails.
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



refreshingview with textfield items that use validatior

2008-05-22 Thread i ii

how can use refreshingview with textfield items that use validatior? when i use 
and validator fails all textfield values reset. i want reset every request, but 
not when validator fails.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RefreshingView example broken

2007-09-28 Thread Kent Tong



Nick Busey wrote:
> 
> Hey, I'm trying to use a RefreshingView, but can't figure it out. On top
> of that, the examples are broken: 
> http://wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.repeater.RefreshingPage
> http://wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.repeater.RefreshingPage
> .
> 
> Can someone either fix that example or point me to another example? 
> 

A quick example:

public Home() {
    RefreshingView view = new RefreshingView("view") {
protected Iterator getItemModels() {
List models = new
ArrayList();
int n = new Random().nextInt(10);
for (int i = 0; i < n; i++) {
models.add(new Model(i));
}
return models.iterator();
}
protected void populateItem(Item item) {
item.add(new Label("label",
item.getModel()));
}
};
add(view);
}

-- 
View this message in context: 
http://www.nabble.com/RefreshingView-example-broken-tf4536092.html#a12951981
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RefreshingView example broken

2007-09-28 Thread Nick Busey

Hey, I'm trying to use a RefreshingView, but can't figure it out. On top of
that, the examples are broken: 
http://wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.repeater.RefreshingPage
http://wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.repeater.RefreshingPage
.

Can someone either fix that example or point me to another example? 
-- 
View this message in context: 
http://www.nabble.com/RefreshingView-example-broken-tf4536092.html#a12946006
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RefreshingView only gets rendered when TreeTable node is opened twice

2007-08-27 Thread Matej Knopp
fixed

On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> file a jira issue and attached a quickstart:
> https://issues.apache.org/jira/browse/WICKET-892
>
> On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> >
> > i'm using trunk (as of yesterday) 1.3.0-SNAPSHOT
> > i'll file a jira issue later today, including a quickstart
> >   gerolf
> >
> > On 8/27/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> > >
> > > It's probably a bug, can you please fill in a JIRA entry and assign it
> > > to
> > > me? What wicket version are you using?
> > >
> > > -Matej
> > >
> > > On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> > > >
> > > > hi,
> > > >
> > > > i have a refreshingview in a treetable column, but it only gets
> > > rendered
> > > > after opening, closing and again opening the corresponding treenode.
> > > >
> > > > did anyone else notice this misbehavior?
> > > >
> > > >
> > > > thanks for any hints,
> > > >   gerolf
> > > >
> > >
> >
> >
>


Re: RefreshingView only gets rendered when TreeTable node is opened twice

2007-08-27 Thread Gerolf Seitz
file a jira issue and attached a quickstart:
https://issues.apache.org/jira/browse/WICKET-892

On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> i'm using trunk (as of yesterday) 1.3.0-SNAPSHOT
> i'll file a jira issue later today, including a quickstart
>   gerolf
>
> On 8/27/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> >
> > It's probably a bug, can you please fill in a JIRA entry and assign it
> > to
> > me? What wicket version are you using?
> >
> > -Matej
> >
> > On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> > >
> > > hi,
> > >
> > > i have a refreshingview in a treetable column, but it only gets
> > rendered
> > > after opening, closing and again opening the corresponding treenode.
> > >
> > > did anyone else notice this misbehavior?
> > >
> > >
> > > thanks for any hints,
> > >   gerolf
> > >
> >
>
>


Re: RefreshingView only gets rendered when TreeTable node is opened twice

2007-08-26 Thread Gerolf Seitz
i'm using trunk (as of yesterday) 1.3.0-SNAPSHOT
i'll file a jira issue later today, including a quickstart
  gerolf

On 8/27/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
>
> It's probably a bug, can you please fill in a JIRA entry and assign it to
> me? What wicket version are you using?
>
> -Matej
>
> On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> >
> > hi,
> >
> > i have a refreshingview in a treetable column, but it only gets rendered
> > after opening, closing and again opening the corresponding treenode.
> >
> > did anyone else notice this misbehavior?
> >
> >
> > thanks for any hints,
> >   gerolf
> >
>


Re: RefreshingView only gets rendered when TreeTable node is opened twice

2007-08-26 Thread Matej Knopp
It's probably a bug, can you please fill in a JIRA entry and assign it to
me? What wicket version are you using?

-Matej

On 8/27/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> i have a refreshingview in a treetable column, but it only gets rendered
> after opening, closing and again opening the corresponding treenode.
>
> did anyone else notice this misbehavior?
>
>
> thanks for any hints,
>   gerolf
>


RefreshingView only gets rendered when TreeTable node is opened twice

2007-08-26 Thread Gerolf Seitz
hi,

i have a refreshingview in a treetable column, but it only gets rendered
after opening, closing and again opening the corresponding treenode.

did anyone else notice this misbehavior?


thanks for any hints,
  gerolf