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

2017-08-18 Thread durairaj t
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-18 Thread Bas Gooren
Hi Ulrich,

My guess (based on quickly looking at your code on my phone): the
DeafultNestedTree probably uses a model to store open/closed state or
selected states. Since you don't provide it in the constructor, wicket
automatically creates a property model since a parent component has a
CompoundPropertyModel.

Check if the DNT has additional constructors which take an
IModel>. Provide your own model and your problem
should be fixed :-)

// Bas

Verstuurd vanaf mijn iPhone

> Op 18 aug. 2017 om 15:37 heeft Knaack, Ulrich 
>  het volgende geschreven:
>
> Hi,
>
> I'm trying to display a DefaultNestedTree (id="dataTreeView") within a 
> Bootstrap Modal
>
> Instances of Service contain an ID that I use for retrieving a recursive data 
> structure from database.
> The recursive structure is realized by instances of "RecursiveData" .
> See line 15 and method onModelChanged().
> RecursiveData contains self referencing properties "parent" and "children"
>
> 00 import com.example.Service
> 00
> 01 public class DataViewDialog extends Modal
> 02 {
> 03 private static final long serialVersionUID = 7766394608644043929L;
> 04
> 05 @SpringBean
> 06 private RecursiveDataBean dataBean;
> 07
> 08 private RecursiveDataTreeProvider treeProvider;
> 09
> 10 public DataViewDialog(String id, IModel model)
> 11 {
> 12 super(id, model);
> 13
> 14 Service service = model.getObject();
> 15 List data = 
> dataBean.getRootDataByServiceId(service.getServiceId());
> 16
> 17 BootstrapForm form = new BootstrapForm<>("form");
> 18 add(form);
> 19
> 20 treeProvider = new RecursiveDataTreeProvider(data);
> 21
> 22 DefaultNestedTree tree =
> 23 new DefaultNestedTree("dataTreeView"
> 24 , treeProvider)
> 25 {
> 26 private static final long serialVersionUID = 
> -7659715973883984412L;
> 27
> 28 @Override
> 29 protected Component newContentComponent(String id1
> 30 , IModel node)
> 31 {
> 32 return super.newContentComponent(id1, node);
> 33 }
> 34 };
> 35
> 36 form.add(tree);
> 37
> 38 BootstrapAjaxButton close = new BootstrapAjaxButton("close"
> 39 , Model.of("schließen"), Buttons.Type.Primary)
> 40 {
> 41 private static final long serialVersionUID = 
> 7877084020329862442L;
> 42
> 43 @Override
> 44 protected void onSubmit(AjaxRequestTarget target, Form form)
> 45 {
> 46 super.onSubmit(target, form);
> 47 appendCloseDialogJavaScript(target);
> 48 }
> 49 };
> 50 form.add(close);
> 51 }
> 52
> 53 @Override
> 54 protected void onModelChanged()
> 55 {
> 56 super.onModelChanged();
> 57 String serviceId = getModel().getObject().getServiceId();
> 58 List newDataList = 
> dataBean.getRootDataByServiceId(serviceId);
> 59 treeProvider.setRecursiveData(newDataList);
> 60 }
> 61 }
>
> I know from debugging that my implementation of ITreeProvider 
> is working well,
> also after execution of "onModelChanged()".
>
> But when the tree is rendered, this error occurs:
>
> org.apache.wicket.WicketRuntimeException: Property could not be resolved for 
> class: class  com.example.Service  expression: dataTreeView
> at 
> org.apache.wicket.core.util.lang.PropertyResolver.getGetAndSet(PropertyResolver.java:393)
> at 
> org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:355)
> at 
> org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:261)
> at 
> org.apache.wicket.core.util.lang.PropertyResolver.getValue(PropertyResolver.java:111)
> at 
> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:86)
> at 
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getModelObject(AbstractTree.java:161)
> at 
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getState(AbstractTree.java:240)
> at 
> org.apache.wicket.extensions.markup.html.repeater.tree.nested.Subtree.isVisible(Subtree.java:136)
>
> Why does Wicket try to resolve a property that doesn't exist within "Service" 
> ?
>
> I've tried a version without a BootstrapForm within the Modal, where 
> "dataTreeView" is attached to the Modal directly. Same problem.
>
> Mit freundlichen Grüßen
> Ulrich Knaack
>
> Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN)
> - Landesvermessung und Geobasisinformation - Landesbetrieb -
> Fachgebiet 224 - Geodateninfrastruktur
> Podbielskistraße 331, 30659 Hannover
> Tel.: +49 511 64609-287
> Fax: +49 511 64609-161
> mailto:ulrich.kna...@lgln.niedersachsen.de
> www.lgln.niedersachsen.de
>
>

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

2017-08-18 Thread Sven Meier

Hi,

nested tree stores the expansion of its nodes in its model.

You have added your tree to a component with a CompoundPropertyModel, 
thus the tree is inheriting its model from that parental component.


You can override #initModel() and let it call #newModel() directly, this 
skips the "compound property model inheriting" stuff.


Hope this helps
Sven


Am 18.08.2017 um 15:36 schrieb Knaack, Ulrich:

Hi,

I'm trying to display a DefaultNestedTree (id="dataTreeView") within a Bootstrap 
Modal

Instances of Service contain an ID that I use for retrieving a recursive data 
structure from database.
The recursive structure is realized by instances of "RecursiveData" .
See line 15 and method onModelChanged().
RecursiveData contains self referencing properties "parent" and "children"

00 import com.example.Service
00
01 public class DataViewDialog extends Modal
02 {
03 private static final long serialVersionUID = 7766394608644043929L;
04
05 @SpringBean
06 private RecursiveDataBean dataBean;
07
08 private RecursiveDataTreeProvider treeProvider;
09
10 public DataViewDialog(String id, IModel model)
11 {
12 super(id, model);
13
14 Service service = model.getObject();
15 List data = 
dataBean.getRootDataByServiceId(service.getServiceId());
16
17 BootstrapForm form = new BootstrapForm<>("form");
18 add(form);
19
20 treeProvider = new RecursiveDataTreeProvider(data);
21
22 DefaultNestedTree tree =
23 new DefaultNestedTree("dataTreeView"
24 , treeProvider)
25 {
26 private static final long serialVersionUID = 
-7659715973883984412L;
27
28 @Override
29 protected Component newContentComponent(String id1
30 , IModel node)
31 {
32 return super.newContentComponent(id1, node);
33 }
34 };
35
36 form.add(tree);
37
38 BootstrapAjaxButton close = new BootstrapAjaxButton("close"
39 , Model.of("schließen"), Buttons.Type.Primary)
40 {
41 private static final long serialVersionUID = 
7877084020329862442L;
42
43 @Override
44 protected void onSubmit(AjaxRequestTarget target, Form form)
45 {
46 super.onSubmit(target, form);
47 appendCloseDialogJavaScript(target);
48 }
49 };
50 form.add(close);
51 }
52
53 @Override
54 protected void onModelChanged()
55 {
56 super.onModelChanged();
57 String serviceId = getModel().getObject().getServiceId();
58 List newDataList = 
dataBean.getRootDataByServiceId(serviceId);
59 treeProvider.setRecursiveData(newDataList);
60 }
61 }

I know from debugging that my implementation of ITreeProvider is 
working well,
also after execution of "onModelChanged()".

But when the tree is rendered, this error occurs:

org.apache.wicket.WicketRuntimeException: Property could not be resolved for 
class: class  com.example.Service  expression: dataTreeView
  at 
org.apache.wicket.core.util.lang.PropertyResolver.getGetAndSet(PropertyResolver.java:393)
  at 
org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:355)
  at 
org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:261)
  at 
org.apache.wicket.core.util.lang.PropertyResolver.getValue(PropertyResolver.java:111)
  at 
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:86)
  at 
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getModelObject(AbstractTree.java:161)
  at 
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getState(AbstractTree.java:240)
  at 
org.apache.wicket.extensions.markup.html.repeater.tree.nested.Subtree.isVisible(Subtree.java:136)

Why does Wicket try to resolve a property that doesn't exist within "Service" ?

I've tried a version without a BootstrapForm within the Modal, where 
"dataTreeView" is attached to the Modal directly. Same problem.

Mit freundlichen Grüßen
Ulrich Knaack

Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN)
- Landesvermessung und Geobasisinformation - Landesbetrieb -
Fachgebiet 224 - Geodateninfrastruktur
Podbielskistraße 331, 30659 Hannover
Tel.:+49 511 64609-287
Fax: +49 511 64609-161
mailto:ulrich.kna...@lgln.niedersachsen.de
www.lgln.niedersachsen.de


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




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

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

2017-08-18 Thread durairaj t
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!


why is DefaultNestedTree component treated as property within PropertyResolver ?

2017-08-18 Thread Knaack, Ulrich
Hi,

I'm trying to display a DefaultNestedTree (id="dataTreeView") within a 
Bootstrap Modal

Instances of Service contain an ID that I use for retrieving a recursive data 
structure from database.
The recursive structure is realized by instances of "RecursiveData" .
See line 15 and method onModelChanged(). 
RecursiveData contains self referencing properties "parent" and "children"

00 import com.example.Service
00
01 public class DataViewDialog extends Modal
02 {
03 private static final long serialVersionUID = 7766394608644043929L;
04 
05 @SpringBean
06 private RecursiveDataBean dataBean;
07 
08 private RecursiveDataTreeProvider treeProvider;
09 
10 public DataViewDialog(String id, IModel model)
11 {
12 super(id, model);
13 
14 Service service = model.getObject();
15 List data = 
dataBean.getRootDataByServiceId(service.getServiceId());
16 
17 BootstrapForm form = new BootstrapForm<>("form");
18 add(form);
19 
20 treeProvider = new RecursiveDataTreeProvider(data);
21 
22 DefaultNestedTree tree =
23 new DefaultNestedTree("dataTreeView"
24 , treeProvider)
25 {
26 private static final long serialVersionUID = 
-7659715973883984412L;
27 
28 @Override
29 protected Component newContentComponent(String id1
30 , IModel node)
31 {
32 return super.newContentComponent(id1, node);
33 }
34 };
35 
36 form.add(tree);
37 
38 BootstrapAjaxButton close = new BootstrapAjaxButton("close"
39 , Model.of("schließen"), Buttons.Type.Primary)
40 {
41 private static final long serialVersionUID = 
7877084020329862442L;
42 
43 @Override
44 protected void onSubmit(AjaxRequestTarget target, Form form)
45 {
46 super.onSubmit(target, form);
47 appendCloseDialogJavaScript(target);
48 }
49 };
50 form.add(close);
51 }
52 
53 @Override
54 protected void onModelChanged()
55 {
56 super.onModelChanged();
57 String serviceId = getModel().getObject().getServiceId();
58 List newDataList = 
dataBean.getRootDataByServiceId(serviceId);
59 treeProvider.setRecursiveData(newDataList);
60 }
61 }

I know from debugging that my implementation of ITreeProvider is 
working well,
also after execution of "onModelChanged()".

But when the tree is rendered, this error occurs:

org.apache.wicket.WicketRuntimeException: Property could not be resolved for 
class: class  com.example.Service  expression: dataTreeView
 at 
org.apache.wicket.core.util.lang.PropertyResolver.getGetAndSet(PropertyResolver.java:393)
 at 
org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:355)
 at 
org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:261)
 at 
org.apache.wicket.core.util.lang.PropertyResolver.getValue(PropertyResolver.java:111)
 at 
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:86)
 at 
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getModelObject(AbstractTree.java:161)
 at 
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getState(AbstractTree.java:240)
 at 
org.apache.wicket.extensions.markup.html.repeater.tree.nested.Subtree.isVisible(Subtree.java:136)

Why does Wicket try to resolve a property that doesn't exist within "Service" ?

I've tried a version without a BootstrapForm within the Modal, where 
"dataTreeView" is attached to the Modal directly. Same problem.

Mit freundlichen Grüßen
Ulrich Knaack

Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN)
- Landesvermessung und Geobasisinformation - Landesbetrieb -
Fachgebiet 224 - Geodateninfrastruktur
Podbielskistraße 331, 30659 Hannover
Tel.:+49 511 64609-287
Fax: +49 511 64609-161
mailto:ulrich.kna...@lgln.niedersachsen.de
www.lgln.niedersachsen.de


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



Re: JEE in hands of ASF

2017-08-18 Thread Tobias Soloschenko
So you already gave the answer before my question was written. :-D

I also hope that ASF is going to be the choice, but we will see.

kind regards

Tobias

> Am 18.08.2017 um 09:57 schrieb Martin Grigorov :
> 
> https://twitter.com/mtgrigorov/status/898435918507384833 :-)
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Fri, Aug 18, 2017 at 10:50 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> oracle release the news that there are plans to hand over JEE to an open
>> source org to speed up the development:
>> 
>> * https://m.heise.de/developer/meldung/Oracle-will-Java-EE-
>> an-die-Open-Source-Community-uebertragen-3806673.html (german)
>> * https://blogs.oracle.com/theaquarium/opening-up-java-ee (original blog)
>> * https://mobile.twitter.com/reza_rahman/status/896128633537822720
>> (independent vote)
>> 
>> Sounds interesting - WDYT
>> 
>> kind regards
>> 
>> Tobias

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



Re: JEE in hands of ASF

2017-08-18 Thread Martin Grigorov
https://twitter.com/mtgrigorov/status/898435918507384833 :-)

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

On Fri, Aug 18, 2017 at 10:50 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> oracle release the news that there are plans to hand over JEE to an open
> source org to speed up the development:
>
> * https://m.heise.de/developer/meldung/Oracle-will-Java-EE-
> an-die-Open-Source-Community-uebertragen-3806673.html (german)
> * https://blogs.oracle.com/theaquarium/opening-up-java-ee (original blog)
> * https://mobile.twitter.com/reza_rahman/status/896128633537822720
> (independent vote)
>
> Sounds interesting - WDYT
>
> kind regards
>
> Tobias


JEE in hands of ASF

2017-08-18 Thread Tobias Soloschenko
Hi,

oracle release the news that there are plans to hand over JEE to an open source 
org to speed up the development:

* 
https://m.heise.de/developer/meldung/Oracle-will-Java-EE-an-die-Open-Source-Community-uebertragen-3806673.html
 (german)
* https://blogs.oracle.com/theaquarium/opening-up-java-ee (original blog)
* https://mobile.twitter.com/reza_rahman/status/896128633537822720 (independent 
vote)

Sounds interesting - WDYT

kind regards

Tobias