You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Itun (JIRA)" <ji...@apache.org> on 2010/09/15 21:59:35 UTC

[jira] Closed: (WICKET-3047) Unscheduled onClick

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

Itun closed WICKET-3047.
------------------------


> Unscheduled onClick
> -------------------
>
>                 Key: WICKET-3047
>                 URL: https://issues.apache.org/jira/browse/WICKET-3047
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.10
>            Reporter: Itun
>            Assignee: Igor Vaynberg
>
> public final class NewsListPanel extends Panel { 
>     @SpringBean 
>     NewsService service; 
>     private List<News> NewsList; 
>     private PageableListView PAListView; 
>     public PageableListView getPAListView() { 
>         return PAListView; 
>     } 
>     public NewsListPanel(String id, List<News> NewsList) { 
>         super(id); 
>         this.NewsList = NewsList; 
>         PAListView = new PageableListView("NewsList", NewsList, 5) { 
>             @Override 
>             protected void populateItem(ListItem item) { 
>                 News news = (News) item.getModelObject(); 
>                 item.add(new ActionLink("Delete", news) { 
>                     @Override 
>                     public void onClick() { 
>                         service.deleteNews(news); 
>                         setResponsePage(new NewsPage()); 
>                     } 
>                 }); 
>                 item.add(new Label("Time", DateUtils.timeFormatted(news.getTimestamp()))); 
>                 item.add(new Label("Title", news.getTitle())); 
>                 item.add(new Label("Content", news.getContent()).setEscapeModelStrings(false)); 
>             } 
>         }; 
>         add(PAListView); 
>     } 
>     private class ActionLink extends Link { 
>         News news; 
>         public ActionLink(String id, News news) { 
>             super(id); 
>             this.news = news; 
>         } 
>         @Override 
>         public void onClick() { 
>             throw new UnsupportedOperationException("Not supported yet."); 
>         } 
>     } 
> } 
> In this code, when there is an onClick processing, everything is going well. But when NewsPage(this panel is here) is generated after onClick event, suddenly Unscheduled onClick has appeared with News object which never existed.

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