You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Louis Savoldy (JIRA)" <ji...@apache.org> on 2008/07/28 23:28:32 UTC

[jira] Updated: (WICKET-1760) Add an additional item reuse strategy to reuse items if an identified feedback message type occurs.

     [ https://issues.apache.org/jira/browse/WICKET-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Louis Savoldy updated WICKET-1760:
----------------------------------

    Attachment: FeedbackMessageReuseStrategy.java

feedback message item reuse strategy implementation (reuse items based on Wicket feedback messages)

> Add an additional item reuse strategy to reuse items if an identified feedback message type occurs.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1760
>                 URL: https://issues.apache.org/jira/browse/WICKET-1760
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>            Reporter: Louis Savoldy
>         Attachments: FeedbackMessageReuseStrategy.java
>
>   Original Estimate: 6h
>  Remaining Estimate: 6h
>
> Note:  the implementation is attached.
> Add an additional item reuse strategy to reuse items if an identified feedback message type occurs.  As an example, this reuse strategy can be used with a refreshing view to set the items back to their original values in the event of a page validation error.  Although the existing ReuseIfModelsEqualStrategy can also be used to accomplish this, you must override the model's equals/hashcode for proper implementation (which is not always feasible based on the models complexity and depth).  
> *All that is required to use this strategy is to set the item reuse (i.e. no need to override equals/hashcode)
> The usage of the new strategy would be as follows:
> Usage Example 1: If you want to redisplay the existing items of the refreshing view if a feed back message is generated of type warning or higher (warning, error, or fatal), you could do the following: 
> refreshingViewInstance.setItemReuseStrategy(new FeedbackMessageReuseStrategy(FeedbackMessageReuseStrategy.Operator.GTE, FeedbackMessage.WARNING));
> Usage Example 2: For feedback message types that  falls between (and including) INFO and ERROR, you could do the following: 
> refreshingViewInstance.setItemReuseStrategy(new FeedbackMessageReuseStrategy(FeedbackMessageReuseStrategy.Operator.BETWEEN, FeedbackMessage.INFO, FeedbackMessage.ERROR));

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.