Re: on click on a label in a listview - onClicke method never used localy

2012-06-14 Thread vineet semwal
add ajaxeventbehavior  to the label


On Thu, Jun 14, 2012 at 8:57 PM, oliver.stef ova...@gmail.com wrote:
 Hi,

 i want to use a label inside listView and i want the user will press on the
 label - and the
 onClick method will work. but what i get is this msg.:

 The method onClick() from the type new Label(){} is never used locally.
 I don't know why?!?!?!?!?!

 this is my implement:

 List list = Arrays.asList(new String[] { a, b, c });

        @SuppressWarnings(unchecked)
                ListView listview = new ListView(listview, list) {

                        protected void populateItem(ListItem item) {

                String s = (String)item.getModelObject();
                item.add(new Label(label, item.getModel())
                {
                                        private static final long       
 serialVersionUID        = 1L;

                                        private void onClick()
                        {
                                System.out.println(Hello);

                        }
                }
                );
            }
        };
        add(listview);

 thanks!


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/on-click-on-a-label-in-a-listview-onClicke-method-never-used-localy-tp4649981.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




-- 
thanks,

Vineet Semwal

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



Re: on click on a label in a listview - onClicke method never used localy

2012-06-14 Thread vineet semwal
currently what you have done is you have defined *your own* method so
it never gets used up unless you yourself use it.

On Thu, Jun 14, 2012 at 9:05 PM, vineet semwal vineetsemwa...@gmail.com wrote:
 add ajaxeventbehavior  to the label


 On Thu, Jun 14, 2012 at 8:57 PM, oliver.stef ova...@gmail.com wrote:
 Hi,

 i want to use a label inside listView and i want the user will press on the
 label - and the
 onClick method will work. but what i get is this msg.:

 The method onClick() from the type new Label(){} is never used locally.
 I don't know why?!?!?!?!?!

 this is my implement:

 List list = Arrays.asList(new String[] { a, b, c });

        @SuppressWarnings(unchecked)
                ListView listview = new ListView(listview, list) {

                        protected void populateItem(ListItem item) {

                String s = (String)item.getModelObject();
                item.add(new Label(label, item.getModel())
                {
                                        private static final long       
 serialVersionUID        = 1L;

                                        private void onClick()
                        {
                                System.out.println(Hello);

                        }
                }
                );
            }
        };
        add(listview);

 thanks!


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/on-click-on-a-label-in-a-listview-onClicke-method-never-used-localy-tp4649981.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




 --
 thanks,

 Vineet Semwal



-- 
thanks,

Vineet Semwal

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



Re: on click on a label in a listview - onClicke method never used localy

2012-06-14 Thread Thomas Götz
Label does not have an onClick() method, so nobody will be calling your 
onClick() ;)
If you want to attach AJAX behavior to the label you should do the following:

final Label label = new Label(label, item.getModel());
label.add(new AjaxEventBehavior(click) {
@Override
protected void onEvent(AjaxRequestTarget target) {
// do something
}
});
item.add(label);


On 14.06.2012 at 17:27 oliver.stef wrote:

 Hi,
 
 i want to use a label inside listView and i want the user will press on the
 label - and the
 onClick method will work. but what i get is this msg.: 
 
 The method onClick() from the type new Label(){} is never used locally. 
 I don't know why?!?!?!?!?!
 
 this is my implement:
 
 List list = Arrays.asList(new String[] { a, b, c });
   
   @SuppressWarnings(unchecked)
   ListView listview = new ListView(listview, list) {

 
   protected void populateItem(ListItem item) {
   
   String s = (String)item.getModelObject();
   item.add(new Label(label, item.getModel())
   {   
   private static final long   
 serialVersionUID= 1L;
 
   private void onClick()
   {
   System.out.println(Hello);
 
   }
   }
   );
   }
   };
   add(listview);
 
 thanks!


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



Re: on click on a label in a listview - onClicke method never used localy

2012-06-14 Thread oliver.stef
Thanks vineetsemwal and Thomas Götz-2 , but still - not working :(

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/on-click-on-a-label-in-a-listview-onClicke-method-never-used-localy-tp4649981p4649989.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: on click on a label in a listview - onClicke method never used localy

2012-06-14 Thread Thomas Götz
What exactly is not working? If you could provide a Quickstart it would be 
easier to help you.

   -Tom


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