Hi Nino,

What have you tested exactly ? 
What I am doing is binding an InputBehavior with the increment links of a
PagingNavigator

public class PolFotoPagingNavigator extends PagingNavigator {


        public PolFotoPagingNavigator(String id, IPageable pageable, boolean
eventListener) {
                super(id, pageable);

                if (eventListener) {
                        visitChildren(PagingNavigationIncrementLink.class, new 
IVisitor() {

                                public Object component(Component component) {
                                        PagingNavigationIncrementLink link = 
(PagingNavigationIncrementLink)
component;
                                        if (link.getId().equals("next")) {
                                                link.add(new InputBehavior(new 
KeyType[] { KeyType.Right
},EventType.click));
                                        }
                                        if (link.getId().equals("prev") ) {
                                                link.add(new InputBehavior(new 
KeyType[] { KeyType.Left
},EventType.click));
                                        }
                                        return null;
                                }
                        });
                }
        }

Using EventType.click generates some javascript like
.... shortcut.add("Left",function() {
                
                document.getElementById('prev1').click();
        },{ .... 
which works fine in IE, also when reaching the paginating boundary but
function click does not exists in FF.

Not using EventType generates some javascript like 
.....shortcut.add("Right",function() {
                                
                                
window.location=document.getElementById('next40').href;
                                
        },{....
Which works fine both in FF and IE until you reach the paginating boundary,
where the next or prev link are not on the page.

Renaud

Nino.Martinez wrote:
> 
> Hi Renaud
> 
> That sounds wierd, I tested it with both IE, safari and FF at the 
> creation time.. Havent used it with PagingNavigationIcnrementLink 
> though.. Is it because the id's of the links change so that they are no 
> longer valid when you click them?
> 
> Could you provide an code snipplet of what youre doing?
> 
> 
> renaud.houver wrote:
>> Hi,
>>
>> I am using InputBehavior() from wicket-contrib-input-event  with
>> EventType.click to bind a shortcut to a PagingNavigationIncrementLink.
>> EventType.click is using a javascript function click() which only exists
>> in
>> IE and does not work in FF.
>> FF would say click is not a function.
>> Not using any eventtype would work but when reaching the end of the
>> pagination, the "next" link is invisible   
>> and the shortcut will fail.    
>>
>> Does anyone knows a good way to do that ? ? 
>>
>> Thanks,
>> Renaud
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/InputBehavior-EventType.click-only-works-in-IE-tp17794918p17840983.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to