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<Contact> model(Contact 
object)
                                        {
                                                return new 
CompoundPropertyModel<Contact>(
                                                        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<[email protected]> 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<[email protected]>
>>> 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); * }
>>>> ///////////////////////////////////////////////////////////////////////////
>>>>
>>>> <!--      Markup file code fragment   -->
>>>>
>>>> *<tr wicket:id="simple">*
>>>> <td width=5>**</td>
>>>> <td>&nbsp;</td>
>>>> <td>&nbsp;</td>
>>>> <td>&nbsp;</td>
>>>> <td><input type="text" wicket:id="amount" style="width:30px"
>>>> tabindex="3"></input></td>
>>>> *</tr>*
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>
>> --
>> 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: [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/FeedbackIndicator-doesn%27t-work-inside-RefreshingView-tp24804087p24870516.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]

Reply via email to