Re: Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Manfred Bergmann
I'll try that. Thanks guys.
Have opened issue on GitHub.


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-ToolbarButton-renders-href-which-removes-existing-URL-fragment-tp4677304p4677312.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: Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Sebastien
Hi Manfred, Hi Martin,

Unfortunately this part does not rely on the integration but on kendo-ui
itself, so I'm afraid we have to hack a bit :(

Changing the href attribute should be done when data are loaded, the idea
is to identify buttons with a special css class and update the href on
databound event.
Something like that:

private CommandButton btnEdit = new CommandButton("_edit",
Model.of("Edit")) {

private static final long serialVersionUID = 1L;

@Override
public String getCSSClass()
{
return "link-to-change";
}
};


class MyDataTable {

protected void onInitialize()
{
super.onInitialize();

this.add(new DataBoundBehavior() {

private static final long serialVersionUID = 1L;

@Override
protected String getDataBoundCallback()
{
return "function (e) { "
+ "jQuery('.link-to-change').each("
+ "function(index, item) { "
+ "jQuery(item).attr('href',
'javascript:;'); "
+ "}"
+ ")"
+ "}";
}
});
}
}

There should be a way to have a generic Behavior, like
NoHashSymbolOnButtonsDataBoundBehavior (yes, I'm pretty imaginative tonight)
Please open en issue on github :)

Best regards,
Sebastien.


Re: Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Martin Grigorov
On Mon, Mar 13, 2017 at 6:21 PM, Manfred Bergmann 
wrote:

> Martin Grigorov-4 wrote
> > If Wicket-JQuery-UI adds this "#" then I'd recommend to replace it with
> > href="javascript:;". Some prefer "javascript:void(0)" but this is a bit
> > longer.
> > "#" has such side effects.
>
> OK, how would I do that. Via AttributeModifier? Because it doesn't seem to
> be rendered during the component render phase.
>

You'll have to find who generates this piece of code - KendoUI or
Wicket-JQuery-UI.
I've found just
https://github.com/sebfz1/wicket-jquery-ui/blob/ab7d16751b728aeb6a6652f7554861bdff743b54/wicket-kendo-ui/src/main/java/com/googlecode/wicket/kendo/ui/widget/menu/Menu.html#L41
in Wicket-JQuery-UI, so it might be KendoUI.


>
>
> Manfred
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Kendo-UI-ToolbarButton-renders-href-
> which-removes-existing-URL-fragment-tp4677304p4677308.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: Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Manfred Bergmann
Martin Grigorov-4 wrote
> If Wicket-JQuery-UI adds this "#" then I'd recommend to replace it with
> href="javascript:;". Some prefer "javascript:void(0)" but this is a bit
> longer.
> "#" has such side effects.

OK, how would I do that. Via AttributeModifier? Because it doesn't seem to
be rendered during the component render phase.


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-ToolbarButton-renders-href-which-removes-existing-URL-fragment-tp4677304p4677308.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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Martin Grigorov
On Mon, Mar 13, 2017 at 6:11 PM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> found that org.apache.wicket:wicket-core:jar:8.0.0-M4 use
> com.tdunning:json
>
> 
> com.tdunning
> json
> 
>
>
> de.agilecoders.wicket:wicket-bootstrap-extensions:jar:2.0.0-M2 use
> com.google.javascript:closure-compiler:v20130603
>
> 
> com.google.javascript
> closure-compiler
> v20130603
> 
>
> which use org.json:json
>
> 
> org.json
> json
> 20090211
> 
>
>
> Both json projects have the same package structure and the same class
> naming
>

This is a similar problem like the one at
https://issues.apache.org/jira/browse/WICKET-6329

But still this doesn't explain why 8.0.0-SNAPSHOT doesn't have the problem
for you.
Wicket uses org.github.openjson to generate its JS stuff and it has been
fixed just an hour ago.


>
>
> François
>
>
>
> > Le 13 mars 2017 à 15:43, Martin Grigorov  a écrit
> :
> >
> > On Mon, Mar 13, 2017 at 3:23 PM, Francois Meillet <
> > francois.meil...@gmail.com > wrote:
> >
> >> AbstractDefaultAjaxBehavior
> >>
> >> protected final CharSequence renderAjaxAttributes(final Component
> >> component, AjaxRequestAttributes attributes) {
> >>
> >>.../...
> >>
> >>
> >>List dynamicExtraParameters =
> >> attributes.getDynamicExtraParameters();
> >>if (dynamicExtraParameters != null)
> >>{
> >>for (CharSequence dynamicExtraParameter :
> >> dynamicExtraParameters)
> >>{
> >>String func =
> >> String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE,
> dynamicExtraParameter);
> >>
> >>---> 8.0.0-SNAPSHOT func =
> >> function(attrs){return Wicket.BrowserInfo.collect()}
> >>
> >>---> 8.0.0-M4
> >> func =  function(attrs){return Wicket.BrowserInfo.collect()}
> >>
> >>
> >>JSONFunction function = new
> >> JSONFunction(func);
> >>attributesJson.append(
> >> AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), function);
> >>
> >>---> 8.0.0-SNAPSHOT
> >> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[
> function(attrs){return
> >> Wicket.BrowserInfo.collect()}]}
> >>
> >>---> 8.0.0-M4
> >> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["
> function(attrs){return
> >> Wicket.BrowserInfo.collect()}"]}
> >>
> >
> > I don't see why this works in -SNAPSHOT ...
> > https://github.com/openjson/openjson/blob/master/src/main/
> java/com/github/openjson/JSONObject.java#L327 <
> https://github.com/openjson/openjson/blob/master/src/main/
> java/com/github/openjson/JSONObject.java#L327>
> > doesn't have support for lists/collections yet
> >
> >
> >>}
> >>}
> >>
> >> François
> >>
> >>
> >>
> >>> Le 13 mars 2017 à 11:57, Martin Grigorov  a
> écrit
> >> :
> >>>
> >>> 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
> >>> But AFAIK the problem is not fixed there. If you have time to debug why
> >> it
> >>> works it would be helpful!
> >>> Mikhail is going to implement the missing #put(String, Collection|Map)
> >>> methods and make a release. Then we will update all branches!
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
> >>> francois.meil...@gmail.com> wrote:
> >>>
>  Hi Martin,
> 
>  I do not get any error with the 8.0.0-SNAPSHOT
> 
>  François
> 
> 
> 
> > Le 13 mars 2017 à 10:14, Martin Grigorov  a
> >> écrit
>  :
> >
> > Hi Francois,
> >
> > It is strange that it fails when built on Mac only.
> > But the issue looks the same as the one reported by Sebastien.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> > francois.meil...@gmail.com> wrote:
> >
> >> I forgot to say  : Apache Wicket 8.0.0-M4
> >>
> >> François
> >>
> >>
> >>
> >>
> 
> 
>  -
>  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  users-unsubscr...@wicket.apache.org>
> >> For additional commands, e-mail: 

Re: Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Martin Grigorov
Hi,

On Mon, Mar 13, 2017 at 5:37 PM, Manfred Bergmann 
wrote:

> Hi.
>
> The DataTable component has Toolbar-/CommandButtons which seem to be
> rendered (by JavaScript) like this:
> Button name <#>
>
> The href="#" causes a problem because once the button is clicked it deletes
> the existing URL fragment which must be kept intact.
>
> What could be done to remove the href="#", since it seems to be rendered
> after onDomReady or so?
>

If Wicket-JQuery-UI adds this "#" then I'd recommend to replace it with
href="javascript:;". Some prefer "javascript:void(0)" but this is a bit
longer.
"#" has such side effects.


>
>
> Manfred
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Kendo-UI-ToolbarButton-renders-href-
> which-removes-existing-URL-fragment-tp4677304.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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
found that org.apache.wicket:wicket-core:jar:8.0.0-M4 use com.tdunning:json


com.tdunning
json



de.agilecoders.wicket:wicket-bootstrap-extensions:jar:2.0.0-M2 use 
com.google.javascript:closure-compiler:v20130603


com.google.javascript
closure-compiler
v20130603


which use org.json:json


org.json
json
20090211



Both json projects have the same package structure and the same class naming


François



> Le 13 mars 2017 à 15:43, Martin Grigorov  a écrit :
> 
> On Mon, Mar 13, 2017 at 3:23 PM, Francois Meillet <
> francois.meil...@gmail.com > wrote:
> 
>> AbstractDefaultAjaxBehavior
>> 
>> protected final CharSequence renderAjaxAttributes(final Component
>> component, AjaxRequestAttributes attributes) {
>> 
>>.../...
>> 
>> 
>>List dynamicExtraParameters =
>> attributes.getDynamicExtraParameters();
>>if (dynamicExtraParameters != null)
>>{
>>for (CharSequence dynamicExtraParameter :
>> dynamicExtraParameters)
>>{
>>String func =
>> String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);
>> 
>>---> 8.0.0-SNAPSHOT func =
>> function(attrs){return Wicket.BrowserInfo.collect()}
>> 
>>---> 8.0.0-M4
>> func =  function(attrs){return Wicket.BrowserInfo.collect()}
>> 
>> 
>>JSONFunction function = new
>> JSONFunction(func);
>>attributesJson.append(
>> AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), function);
>> 
>>---> 8.0.0-SNAPSHOT
>> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[function(attrs){return
>> Wicket.BrowserInfo.collect()}]}
>> 
>>---> 8.0.0-M4
>> attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["function(attrs){return
>> Wicket.BrowserInfo.collect()}"]}
>> 
> 
> I don't see why this works in -SNAPSHOT ...
> https://github.com/openjson/openjson/blob/master/src/main/java/com/github/openjson/JSONObject.java#L327
>  
> 
> doesn't have support for lists/collections yet
> 
> 
>>}
>>}
>> 
>> François
>> 
>> 
>> 
>>> Le 13 mars 2017 à 11:57, Martin Grigorov  a écrit
>> :
>>> 
>>> 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
>>> But AFAIK the problem is not fixed there. If you have time to debug why
>> it
>>> works it would be helpful!
>>> Mikhail is going to implement the missing #put(String, Collection|Map)
>>> methods and make a release. Then we will update all branches!
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
 Hi Martin,
 
 I do not get any error with the 8.0.0-SNAPSHOT
 
 François
 
 
 
> Le 13 mars 2017 à 10:14, Martin Grigorov  a
>> écrit
 :
> 
> Hi Francois,
> 
> It is strange that it fails when built on Mac only.
> But the issue looks the same as the one reported by Sebastien.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> I forgot to say  : Apache Wicket 8.0.0-M4
>> 
>> François
>> 
>> 
>> 
>> 
 
 
 -
 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 
>> 


Kendo UI - ToolbarButton renders href="#" which removes existing URL fragment

2017-03-13 Thread Manfred Bergmann
Hi.

The DataTable component has Toolbar-/CommandButtons which seem to be
rendered (by JavaScript) like this:
Button name <#>  

The href="#" causes a problem because once the button is clicked it deletes
the existing URL fragment which must be kept intact.

What could be done to remove the href="#", since it seems to be rendered
after onDomReady or so?


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Kendo-UI-ToolbarButton-renders-href-which-removes-existing-URL-fragment-tp4677304.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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Martin Grigorov
On Mon, Mar 13, 2017 at 3:23 PM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> AbstractDefaultAjaxBehavior
>
> protected final CharSequence renderAjaxAttributes(final Component
> component, AjaxRequestAttributes attributes) {
>
> .../...
>
>
> List dynamicExtraParameters =
> attributes.getDynamicExtraParameters();
> if (dynamicExtraParameters != null)
> {
> for (CharSequence dynamicExtraParameter :
> dynamicExtraParameters)
> {
> String func =
> String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);
>
> ---> 8.0.0-SNAPSHOT func =
> function(attrs){return Wicket.BrowserInfo.collect()}
>
> ---> 8.0.0-M4
>  func =  function(attrs){return Wicket.BrowserInfo.collect()}
>
>
> JSONFunction function = new
> JSONFunction(func);
> attributesJson.append(
> AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), function);
>
> ---> 8.0.0-SNAPSHOT
>  attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[function(attrs){return
> Wicket.BrowserInfo.collect()}]}
>
> ---> 8.0.0-M4
>  attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["function(attrs){return
> Wicket.BrowserInfo.collect()}"]}
>

I don't see why this works in -SNAPSHOT ...
https://github.com/openjson/openjson/blob/master/src/main/java/com/github/openjson/JSONObject.java#L327
doesn't have support for lists/collections yet


> }
> }
>
> François
>
>
>
> > Le 13 mars 2017 à 11:57, Martin Grigorov  a écrit
> :
> >
> > 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
> > But AFAIK the problem is not fixed there. If you have time to debug why
> it
> > works it would be helpful!
> > Mikhail is going to implement the missing #put(String, Collection|Map)
> > methods and make a release. Then we will update all branches!
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
> > francois.meil...@gmail.com> wrote:
> >
> >> Hi Martin,
> >>
> >> I do not get any error with the 8.0.0-SNAPSHOT
> >>
> >> François
> >>
> >>
> >>
> >>> Le 13 mars 2017 à 10:14, Martin Grigorov  a
> écrit
> >> :
> >>>
> >>> Hi Francois,
> >>>
> >>> It is strange that it fails when built on Mac only.
> >>> But the issue looks the same as the one reported by Sebastien.
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> >>> francois.meil...@gmail.com> wrote:
> >>>
>  I forgot to say  : Apache Wicket 8.0.0-M4
> 
>  François
> 
> 
> 
> 
> >>
> >>
> >> -
> >> 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
>
>


Wicketstuff UrlFragment - modifying URL calls onParameterArrival

2017-03-13 Thread Manfred Bergmann
Hi.

I'm using UrlFragment Wicketstuff project to manipulate the URL.
When manipulating the URL via putParameter() call, etc. there is an
immediate callback to the page which implements onParameterArrival()
handler.

Can this be avoided somehow?
I'd just like to have this handler being called when someone enters an URL
manually in the browser but not when manipulating the URL via code.


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicketstuff-UrlFragment-modifying-URL-calls-onParameterArrival-tp4677302.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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
AbstractDefaultAjaxBehavior

protected final CharSequence renderAjaxAttributes(final Component component, 
AjaxRequestAttributes attributes) {

.../...


List dynamicExtraParameters = 
attributes.getDynamicExtraParameters();
if (dynamicExtraParameters != null)
{
for (CharSequence dynamicExtraParameter : 
dynamicExtraParameters)
{
String func = 
String.format(DYNAMIC_PARAMETER_FUNCTION_TEMPLATE, dynamicExtraParameter);

---> 8.0.0-SNAPSHOT func =  
function(attrs){return Wicket.BrowserInfo.collect()}

---> 8.0.0-M4   func =  
function(attrs){return Wicket.BrowserInfo.collect()}


JSONFunction function = new 
JSONFunction(func);

attributesJson.append(AjaxAttributeName.DYNAMIC_PARAMETER_FUNCTION.jsonName(), 
function);

---> 8.0.0-SNAPSHOT 
attributesJson.toString() =  {"u":"./.?2-1.0-","dep":[function(attrs){return 
Wicket.BrowserInfo.collect()}]}

---> 8.0.0-M4   
attributesJson.toString() =  {"u":"./.?2-1.0-","dep":["function(attrs){return 
Wicket.BrowserInfo.collect()}"]}
}
}

François



> Le 13 mars 2017 à 11:57, Martin Grigorov  a écrit :
> 
> 8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
> But AFAIK the problem is not fixed there. If you have time to debug why it
> works it would be helpful!
> Mikhail is going to implement the missing #put(String, Collection|Map)
> methods and make a release. Then we will update all branches!
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> Hi Martin,
>> 
>> I do not get any error with the 8.0.0-SNAPSHOT
>> 
>> François
>> 
>> 
>> 
>>> Le 13 mars 2017 à 10:14, Martin Grigorov  a écrit
>> :
>>> 
>>> Hi Francois,
>>> 
>>> It is strange that it fails when built on Mac only.
>>> But the issue looks the same as the one reported by Sebastien.
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
>>> francois.meil...@gmail.com> wrote:
>>> 
 I forgot to say  : Apache Wicket 8.0.0-M4
 
 François
 
 
 
 
>> 
>> 
>> -
>> 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: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Martin Grigorov
8.0.0-SNAPSHOT uses https://github.com/openjson/openjson
But AFAIK the problem is not fixed there. If you have time to debug why it
works it would be helpful!
Mikhail is going to implement the missing #put(String, Collection|Map)
methods and make a release. Then we will update all branches!

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

On Mon, Mar 13, 2017 at 11:44 AM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> Hi Martin,
>
> I do not get any error with the 8.0.0-SNAPSHOT
>
> François
>
>
>
> > Le 13 mars 2017 à 10:14, Martin Grigorov  a écrit
> :
> >
> > Hi Francois,
> >
> > It is strange that it fails when built on Mac only.
> > But the issue looks the same as the one reported by Sebastien.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> > francois.meil...@gmail.com> wrote:
> >
> >> I forgot to say  : Apache Wicket 8.0.0-M4
> >>
> >> François
> >>
> >>
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
Hi Martin,

I do not get any error with the 8.0.0-SNAPSHOT

François



> Le 13 mars 2017 à 10:14, Martin Grigorov  a écrit :
> 
> Hi Francois,
> 
> It is strange that it fails when built on Mac only.
> But the issue looks the same as the one reported by Sebastien.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
> francois.meil...@gmail.com> wrote:
> 
>> I forgot to say  : Apache Wicket 8.0.0-M4
>> 
>> François
>> 
>> 
>> 
>> 


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



Re: Problem with testing AbstractAjaxBehavior

2017-03-13 Thread Martin Grigorov
Hi,

Your code is not formatted and it is quite hard to read and follow it.
Could you please re-send it ?

Also is it possible to try with 6.26.0 ?

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

On Mon, Mar 13, 2017 at 8:07 AM, Hans-Heinrich Braun <
hansheinrichbr...@yahoo.de.invalid> wrote:

> In my Application i have a DropDownSelect which changes a Label onUpdate
> by  AjaxFormComponentUpdatingBehaviorThen there is a Button which tries
> access at the selected item. In the real Webapp it works fine but when i
> test itwhen i click the Button the selected Item is null.What I am doing
> wrong. Here the HomePage:
> public class HomePage extends WebPage { private static final long
> serialVersionUID = 1L; private static final List SEARCH_ENGINES =
> Arrays.asList(new String[] { "Google", "Bing", "Baidu" }); //make Google
> selected by default private String selected = "Google";
> Model model = new Model() {public
> String getObject() {  return getSelected();  }  };
>   private Label chosen=new Label("chosen", model);   public
> HomePage(final PageParameters parameters) { super(parameters);
> FeedbackPanel feedback=new FeedbackPanel("feedback"); add(feedback);
> feedback.setVisible(true); // other pages will set this to visible
>  feedback.setEscapeModelStrings(false); add(new Label("version",
> getApplication().getFrameworkSettings().getVersion()));
> DropDownChoice listSites = new DropDownChoice( "sites", new
> PropertyModel(this, "selected"), SEARCH_ENGINES);
>  Form form = new Form("form");  final   Button detailButton=new
> Button("detailButton") { @Override public void onSubmit()
> {info(getSelected()); } };  detailButton.setOutputMarkupId(true);
> chosen.setOutputMarkupId(true);   listSites.add(new
> AjaxFormComponentUpdatingBehavior("onchange"){
> @Overrideprotected void onUpdate(AjaxRequestTarget target)
>   {  target.add(chosen);
> target.add(detailButton);  }});
> form.add(chosen);  add(form); form.add(listSites); form.add(detailButton);
>   }
>  public String getSelected() { return selected; }
>  public void setSelected(String selected) { this.selected = selected; }}
>
> and here the Test :
> public class TestHomePage{ private WicketTester tester;
>  @Before public void setUp() { tester = new WicketTester(new
> WicketApplication()); }
>  @Test public void homepageRendersSuccessfully() { //start and render the
> test page tester.startPage(HomePage.class);
>  //assert rendered page class tester.assertRenderedPage(HomePage.class);
> FormTester  formTester = tester.newFormTester("form");
> formTester.select("sites", 1);  tester.executeBehavior((
> AbstractAjaxBehavior)tester.getComponentFromLastRenderedPa
> ge("form:sites").getBehaviors().get(0));  tester.assertLabel("form:chosen",
> "Bing");   formTester.submit("detailButton");  
> tester.assertInfoMessages("feedback","Bing");
> }}
> i am using wicket 6.19.0


Re: AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Martin Grigorov
Hi Francois,

It is strange that it fails when built on Mac only.
But the issue looks the same as the one reported by Sebastien.

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

On Mon, Mar 13, 2017 at 8:09 AM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> I forgot to say  : Apache Wicket 8.0.0-M4
>
> François
>
>
>
>


AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
I forgot to say  : Apache Wicket 8.0.0-M4

François





Problem with testing AbstractAjaxBehavior

2017-03-13 Thread Hans-Heinrich Braun
In my Application i have a DropDownSelect which changes a Label onUpdate by  
AjaxFormComponentUpdatingBehaviorThen there is a Button which tries access at 
the selected item. In the real Webapp it works fine but when i test itwhen i 
click the Button the selected Item is null.What I am doing wrong. Here the 
HomePage:
public class HomePage extends WebPage { private static final long 
serialVersionUID = 1L; private static final List SEARCH_ENGINES = 
Arrays.asList(new String[] { "Google", "Bing", "Baidu" }); //make Google 
selected by default private String selected = "Google";
    Model model = new Model() {                    public 
String getObject() {              return getSelected();          }      }; 
      private Label chosen=new Label("chosen", model);   public HomePage(final 
PageParameters parameters) { super(parameters);  FeedbackPanel feedback=new 
FeedbackPanel("feedback"); add(feedback);  feedback.setVisible(true); // other 
pages will set this to visible         feedback.setEscapeModelStrings(false); 
add(new Label("version", 
getApplication().getFrameworkSettings().getVersion()));  DropDownChoice 
listSites = new DropDownChoice( "sites", new 
PropertyModel(this, "selected"), SEARCH_ENGINES);
 Form form = new Form("form");  final   Button detailButton=new 
Button("detailButton") { @Override public void onSubmit() {info(getSelected()); 
} };  detailButton.setOutputMarkupId(true); chosen.setOutputMarkupId(true);   
listSites.add(new AjaxFormComponentUpdatingBehavior("onchange")        {        
    @Override            protected void onUpdate(AjaxRequestTarget target)      
      {                              target.add(chosen);            
target.add(detailButton);                      }        });    
form.add(chosen);  add(form); form.add(listSites); form.add(detailButton);    } 
 public String getSelected() { return selected; }
 public void setSelected(String selected) { this.selected = selected; }}

and here the Test :
public class TestHomePage{ private WicketTester tester;
 @Before public void setUp() { tester = new WicketTester(new 
WicketApplication()); }
 @Test public void homepageRendersSuccessfully() { //start and render the test 
page tester.startPage(HomePage.class);
 //assert rendered page class tester.assertRenderedPage(HomePage.class); 
FormTester  formTester = tester.newFormTester("form"); 
formTester.select("sites", 1);  
tester.executeBehavior((AbstractAjaxBehavior)tester.getComponentFromLastRenderedPage("form:sites").getBehaviors().get(0));
  tester.assertLabel("form:chosen", "Bing");   
formTester.submit("detailButton");  
tester.assertInfoMessages("feedback","Bing"); }}
i am using wicket 6.19.0

AjaxClientInfoBehavior - Ajax request:SyntaxError: function statement requires a name

2017-03-13 Thread Francois Meillet
Hi,

I add an AjaxClientInfoBehavior to a page.

Sometimes I get an error.
This is very strange and I have no clue.

I have 2 computers, 1 Debian, 1 Osx, within the same network.

If I compile the code on the Osx boxe,
publish the war on a Tomcat instance running on the Osx box or on the Debian box
and I call the page with the AjaxClientInfoBehavior, 
I have the following error (in Wicket Ajax Debug)

ERROR: An error occurred while executing Ajax request:SyntaxError: function 
statement requires a name

The code in the page is

/**/


If I compile the code on the Debian box, 
publish the war on a Tomcat instance running the Debian box
I do not get any error

the code in the page is

/**/


What I see from the javascript generated : when error occurs, double quotes are 
present around the function call.

It's very weird !
Cold it be related to Sebastien'message "8.0.0-M4: org.json has issue with 
List" from Mars the 12 ?

Do you have any advice ?

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