Hi, How does it behave in Chrome/Firefox ?
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Aug 18, 2017 at 11:26 PM, durairaj t <durairaj....@gmail.com> wrote: > in IE 11, the "wicket-focusedelementid" is giving the next cell id, but not > in IE compatibility mode(IE7, id remains same). > > Is it due to some error in the ajax behavior which I used to submit the > form *Or* something not supporting in wicket 7? > > > On Fri, Aug 18, 2017 at 10:48 AM, durairaj t <durairaj....@gmail.com> > wrote: > > > I have replaced the following wicket5 getEventHandler() code to wicket7 > as > > it is in the below code snippet, it worked but the cursor focusing the > same > > filed again after the form submission by blur event. This event behavior > > used in the wicket stuff data grid cell, > > > > > > *Expected *functionality: Cursor should focus next cell in “blur” (TAB > > key press). > > > > > > *Actual *functionality: pointing the same field until press the TAB once > > again or use the mouse once again. > > > > > > *Browser*: IE 11, application running in the compatibility mode and > > failing in it, but it is working if I remove the compatibility in IE. > > > > > > What is wrong in the below wic7 code, do I need to handle the focus > > manually or add something else to bring the focus to the next cell? I > have > > no idea? > > > > > > *Any help?* > > > > > > > > > > *Code snippet:* > > > > > > *Wicket 5: -> var wcall=wicketSubmitFormById* > > > > > > @Override > > protected CharSequence getEventHandler() > > { > > if(getEvent().equalsIgnoreCase("onBlur")) { > > String script = "setFieldSearchOn('" + StringEscapeUtils. > > escapeJavaScript(((FormComponent)getComponent()).getValue())+ "', this > > );" ; > > AppendingStringBuffer handler = new AppendingStringBuffer(); > > if (!Strings.isEmpty(script)) > > { > > handler.append(script).append(";"); > > } > > handler.append(super.getEventHandler()); > > handler.append("; return false;"); > > return handler; > > }else { > > return super.getEventHandler(); > > } > > } > > > > > > *Wicket7:-> Wicket.Aajax.ajax* > > > > > > @Override > > protected void updateAjaxAttributes(AjaxRequestAttributes > > ajaxRequestAttributes) { > > super.updateAjaxAttributes(ajaxRequestAttributes); > > AjaxCallListener ajaxCallListener = new AjaxCallListener(); > > if(getEvent().equalsIgnoreCase("blur")) { > > ajaxCallListener.onPrecondition("if(setFieldSearchOn('" + > > StringEscapeUtils.escapeEcmaScript(((FormComponent)getComponent()). > getValue())+ > > "', this ) == false)return false;"); > > //appending "return false" is not working as expected. > > } > > ajaxRequestAttributes.getAjaxCallListeners().add(ajaxCallListener); > > } > > > > Thanks! > > > > >