Re: getEventHandler() and updateAjaxAttributes - cursor focusing the same data grid cell again after the form submission by blur event.

2017-08-21 Thread Martin Grigorov
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  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 
> 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!
> >
> >
>


Re: getEventHandler() and updateAjaxAttributes - cursor focusing the same data grid cell again after the form submission by blur event.

2017-08-21 Thread durairaj t
No issues with the Chrome  and Firefox. It is working as expected.

On Mon, Aug 21, 2017 at 3:54 AM, Martin Grigorov 
wrote:

> 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 
> 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 
> > 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!
> > >
> > >
> >
>


Re: why is DefaultNestedTree component treated as property within PropertyResolver ?

2017-08-21 Thread UlrichKnaack
Thank you both for your hints, I'm just testing with a MCVE.

It seems the behaviour of the DFN depends to which parent it belongs
(WebPage or Modal).
It also seems to matter if the Modal is opened via an AjaxLink in a page or
within a form

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/why-is-DefaultNestedTree-component-treated-as-property-within-PropertyResolver-tp4678549p4678564.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: getEventHandler() and updateAjaxAttributes - cursor focusing the same data grid cell again after the form submission by blur event.

2017-08-21 Thread Martin Grigorov
It looks like some IE 7 quirck...
We do not support IE older than 11.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Aug 21, 2017 at 4:42 PM, durairaj t  wrote:

> No issues with the Chrome  and Firefox. It is working as expected.
>
> On Mon, Aug 21, 2017 at 3:54 AM, Martin Grigorov 
> wrote:
>
> > 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 
> > 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 
> > > 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!
> > > >
> > > >
> > >
> >
>


Re: getEventHandler() and updateAjaxAttributes - cursor focusing the same data grid cell again after the form submission by blur event.

2017-08-21 Thread durairaj t
Thank you martin!


On Mon, Aug 21, 2017 at 10:11 AM, Martin Grigorov 
wrote:

> It looks like some IE 7 quirck...
> We do not support IE older than 11.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Aug 21, 2017 at 4:42 PM, durairaj t 
> wrote:
>
> > No issues with the Chrome  and Firefox. It is working as expected.
> >
> > On Mon, Aug 21, 2017 at 3:54 AM, Martin Grigorov 
> > wrote:
> >
> > > 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 
> > > 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  >
> > > > 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!
> > > > >
> > > > >
> > > >
> > >
> >
>


Button not visible, except that it is...

2017-08-21 Thread Entropy
We have a form that underwent some re-writing.  After the changes, a button
starts throwing the below exception.  The button is in a panel that starts
invisible but is made visible later.  In the event that makes it visible we
logged out the button's isVisibleInHierarchy() and it was false at the
beginning of the method, true at the end.  And the button DID render on the
page.

So if wicket thought the button was visible by it's own method, and chose to
render it, why does it later think it's not visible in the very next event? 
We are not overriding any isVisible() methods in the page.  Any ideas?

org.apache.wicket.WicketRuntimeException: Submit Button
radioWmc2:radioWmc2Step2:btnResResume
(path=form:radioWmc2:radioWmc2Step2:btnResResume) is not visible
at
org.apache.wicket.markup.html.form.Form$2.component(Form.java:456)
at
org.apache.wicket.markup.html.form.Form$2.component(Form.java:437)
at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)
at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:860)
at
org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:435)


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Button-not-visible-except-that-it-is-tp4678567.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: Button not visible, except that it is...

2017-08-21 Thread Martin Grigorov
On Mon, Aug 21, 2017 at 5:47 PM, Entropy  wrote:

> We have a form that underwent some re-writing.  After the changes, a button
> starts throwing the below exception.  The button is in a panel that starts
> invisible but is made visible later.  In the event that makes it visible we
> logged out the button's isVisibleInHierarchy() and it was false at the
> beginning of the method, true at the end.  And the button DID render on the
> page.
>
> So if wicket thought the button was visible by it's own method, and chose
> to
> render it, why does it later think it's not visible in the very next event?
> We are not overriding any isVisible() methods in the page.  Any ideas?
>

Just put a breakpoint at Form.java:456 and see why it thinks it is
invisible.
Most probably some of its parents is not visible if the button itself is.


>
> org.apache.wicket.WicketRuntimeException: Submit Button
> radioWmc2:radioWmc2Step2:btnResResume
> (path=form:radioWmc2:radioWmc2Step2:btnResResume) is not visible
> at
> org.apache.wicket.markup.html.form.Form$2.component(Form.java:456)
> at
> org.apache.wicket.markup.html.form.Form$2.component(Form.java:437)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:860)
> at
> org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.
> java:435)
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Button-not-visible-except-that-it-is-tp4678567.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
>
>


How to get generate html link for page with parameters

2017-08-21 Thread fromgate
Hello!

I need to create text (in fact it will be a confirmation email) that will
contain a link to specific page object with provided parameters
(confirmation code).

Is there a way to render a BookmarkablePageLink object and get a String that
will contain this link?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-get-generate-html-link-for-page-with-parameters-tp4678570.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: How to get generate html link for page with parameters

2017-08-21 Thread Martin Grigorov
Hi,

What you need is just : RequestCycle.get().urlFor(SomePage.class,
somePageParameters)
Otherwise also take a look at
http://examples8x.wicket.apache.org/mailtemplate/ example. It shows how to
render a Page, a Component and how to use TextTemplate.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Aug 21, 2017 at 8:17 PM, fromgate  wrote:

> Hello!
>
> I need to create text (in fact it will be a confirmation email) that will
> contain a link to specific page object with provided parameters
> (confirmation code).
>
> Is there a way to render a BookmarkablePageLink object and get a String
> that
> will contain this link?
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/How-to-get-generate-html-link-for-page-
> with-parameters-tp4678570.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
>
>