How it Feels to Learn Javascript in 2016

2017-01-26 Thread fzb
Must read article if you are thinking to start new app development in Java
script world. Also read the comments below, how many of them had echoed the
same concerns..  

https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.gkg3u1pdp

Wicket is so easy to develop and maintain.. Thank you Guys for continuing to
develop & support Wicket ..
  

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-it-Feels-to-Learn-Javascript-in-2016-tp4676883.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: Ajax request stopped because of precondition check on CheckGroup

2017-01-26 Thread Sven Meier

Hi Martin,

he did use AjaxFormChoiceComponentUpdatingBehavior (as seen in the first 
code snippet).


Too bad we won't know what went wrong here:
You can use multiple AjaxCheckBoxes instead, but it requires much more work.

Have fun
Sven


On 26.01.2017 20:49, Martin Grigorov wrote:

Hi,

On Thu, Jan 26, 2017 at 6:56 PM, SeldonCrisis  wrote:


I just wanted to update this in case anyone else references it in the
future.
While the *Check* fix was a solution to the *"precondition check"* error, I
was still unable to execute the ajax instructions inside the overridden
*"protected void onUpdate(AjaxRequestTarget target){}"* method.


When you use a CheckGroup you have to
use org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior to
receive Ajax notifications when the checkboxes are toggled.



For this reason, I decided to instead use *AjaxCheckBox*, alternatively
implementing all the logic in both overridden *"onUpdate"* methods. I used
an array of Boolean values to represent the values of the Model Objects
since I wouldn't be able to refer to the Model Object of the second
AjaxCheckBox in the onUpdate of the first as it has yet to be instantiated.

*Here's my Java code:*
final Button fileClaimButton;
final CheckBox cb1, cb2;
final boolean[] bArray = {false, false};

fileClaimButton = new AjaxButton("fileClaimButton"){
 private static final long serialVersionUID = 1L;
 @Override
 protected void onSubmit(AjaxRequestTarget target, Form form){
 System.out.print("File Claim Executed");
 }
};
fileClaimButton.setEnabled(false);
fileClaimButton.setOutputMarkupId(true);
fileClaimButton.setOutputMarkupPlaceholderTag(true);

cb1 = new AjaxCheckBox("cg1-cb1", new Model(false)){
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 bArray[0] = getModelObject();
 if (bArray[0] == true && bArray[1] == true)
 fileClaimButton.setEnabled(true);
 else
 fileClaimButton.setEnabled(false);

 target.add(fileClaimButton);
 }};

cb2 = new AjaxCheckBox("cg1-cb2", new Model(false)){
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 bArray[1] = getModelObject();
 if (bArray[0] == true &&  bArray[1] == true)
 fileClaimButton.setEnabled(true);
 else
 fileClaimButton.setEnabled(false);

 target.add(fileClaimButton);
 }};

--
View this message in context: http://apache-wicket.1842946.
n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-
CheckGroup-tp4676865p4676880.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





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



Re: Ajax request stopped because of precondition check on CheckGroup

2017-01-26 Thread Martin Grigorov
Hi,

On Thu, Jan 26, 2017 at 6:56 PM, SeldonCrisis  wrote:

> I just wanted to update this in case anyone else references it in the
> future.
> While the *Check* fix was a solution to the *"precondition check"* error, I
> was still unable to execute the ajax instructions inside the overridden
> *"protected void onUpdate(AjaxRequestTarget target){}"* method.
>

When you use a CheckGroup you have to
use org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior to
receive Ajax notifications when the checkboxes are toggled.


>
> For this reason, I decided to instead use *AjaxCheckBox*, alternatively
> implementing all the logic in both overridden *"onUpdate"* methods. I used
> an array of Boolean values to represent the values of the Model Objects
> since I wouldn't be able to refer to the Model Object of the second
> AjaxCheckBox in the onUpdate of the first as it has yet to be instantiated.
>
> *Here's my Java code:*
> final Button fileClaimButton;
> final CheckBox cb1, cb2;
> final boolean[] bArray = {false, false};
>
> fileClaimButton = new AjaxButton("fileClaimButton"){
> private static final long serialVersionUID = 1L;
> @Override
> protected void onSubmit(AjaxRequestTarget target, Form form){
> System.out.print("File Claim Executed");
> }
> };
> fileClaimButton.setEnabled(false);
> fileClaimButton.setOutputMarkupId(true);
> fileClaimButton.setOutputMarkupPlaceholderTag(true);
>
> cb1 = new AjaxCheckBox("cg1-cb1", new Model(false)){
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> bArray[0] = getModelObject();
> if (bArray[0] == true && bArray[1] == true)
> fileClaimButton.setEnabled(true);
> else
> fileClaimButton.setEnabled(false);
>
> target.add(fileClaimButton);
> }};
>
> cb2 = new AjaxCheckBox("cg1-cb2", new Model(false)){
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> bArray[1] = getModelObject();
> if (bArray[0] == true &&  bArray[1] == true)
> fileClaimButton.setEnabled(true);
> else
> fileClaimButton.setEnabled(false);
>
> target.add(fileClaimButton);
> }};
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-
> CheckGroup-tp4676865p4676880.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: Ajax request stopped because of precondition check on CheckGroup

2017-01-26 Thread SeldonCrisis
I just wanted to update this in case anyone else references it in the future.
While the *Check* fix was a solution to the *"precondition check"* error, I
was still unable to execute the ajax instructions inside the overridden
*"protected void onUpdate(AjaxRequestTarget target){}"* method.

For this reason, I decided to instead use *AjaxCheckBox*, alternatively
implementing all the logic in both overridden *"onUpdate"* methods. I used
an array of Boolean values to represent the values of the Model Objects
since I wouldn't be able to refer to the Model Object of the second
AjaxCheckBox in the onUpdate of the first as it has yet to be instantiated.  

*Here's my Java code:*
final Button fileClaimButton;
final CheckBox cb1, cb2;
final boolean[] bArray = {false, false};

fileClaimButton = new AjaxButton("fileClaimButton"){
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form form){
System.out.print("File Claim Executed");
}
};
fileClaimButton.setEnabled(false);
fileClaimButton.setOutputMarkupId(true);
fileClaimButton.setOutputMarkupPlaceholderTag(true);

cb1 = new AjaxCheckBox("cg1-cb1", new Model(false)){
@Override
protected void onUpdate(AjaxRequestTarget target) {
bArray[0] = getModelObject();
if (bArray[0] == true && bArray[1] == true)
fileClaimButton.setEnabled(true);
else
fileClaimButton.setEnabled(false);

target.add(fileClaimButton);
}};

cb2 = new AjaxCheckBox("cg1-cb2", new Model(false)){
@Override
protected void onUpdate(AjaxRequestTarget target) {
bArray[1] = getModelObject();
if (bArray[0] == true &&  bArray[1] == true)
fileClaimButton.setEnabled(true);
else
fileClaimButton.setEnabled(false);

target.add(fileClaimButton);
}};

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-CheckGroup-tp4676865p4676880.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