Re: wicket-async-task or asynchronous task with wicket

2016-05-11 Thread Martin Grigorov
Hi,

On Wed, May 11, 2016 at 6:53 PM, andre seame  wrote:

> Hello,
>
> I found : http://wicketinaction.com that points
> https://github.com/raphw/wicket-async-task.
>

Which article exactly points to this GitHub project ?


> Is this code the best way of doing asynchronous code with wicket ?
>
> Thanks,
> PHL.
>
>
> 
> De : andre seame 
> Envoyé : mercredi 11 mai 2016 16:25
> À : users@wicket.apache.org
> Objet : wicket-async-task
>
> Hello,
>
>
> When loading data from database, I would like to create my own (textual)
> progression bar. I create a small code (from World Clock Example<
> http://examples7x.wicket.apache.org/ajax/world-clock>) that uses ajax.
> The code does not work. In fact, the wicket renderer does not nothing, it
> waits the end of dowloading information from the database. When all data
> are available, the  progress bar works !
>
>
> Therefore, I create a thread to download the data, but the behavior is the
> same. Nothing happens until the end of datadowloading.
>
>
> How to do thread in wicket ?
>
> Is there a new implementation of
> https://github.com/raphw/wicket-async-task ?
>
> The code was built in 2013!
>
> What is the best way to do thread in wicket ? Does wicket have built-in
> capabilities to manage asynchronous tasks ?
>
>
> Thanks,
>
> PHL.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: wicket-async-task

2016-05-11 Thread Martin Grigorov
On Wed, May 11, 2016 at 6:25 PM, andre seame  wrote:

> Hello,
>
>
> When loading data from database, I would like to create my own (textual)
> progression bar. I create a small code (from World Clock Example<
> http://examples7x.wicket.apache.org/ajax/world-clock>) that uses ajax.
> The code does not work. In fact, the wicket renderer does not nothing, it
> waits the end of dowloading information from the database. When all data
> are available, the  progress bar works !
>
>
> Therefore, I create a thread to download the data, but the behavior is the
> same. Nothing happens until the end of datadowloading.
>
>
> How to do thread in wicket ?
>
> Is there a new implementation of
> https://github.com/raphw/wicket-async-task ?
>

https://github.com/wicketstuff/core/tree/master/async-tasks-parent


>
> The code was built in 2013!
>
> What is the best way to do thread in wicket ? Does wicket have built-in
> capabilities to manage asynchronous tasks ?
>
>
> Thanks,
>
> PHL.
>


RE: wicket-async-task or asynchronous task with wicket

2016-05-11 Thread andre seame
Hello, 

I found : http://wicketinaction.com that points 
https://github.com/raphw/wicket-async-task. 
Is this code the best way of doing asynchronous code with wicket ? 

Thanks, 
PHL.



De : andre seame 
Envoyé : mercredi 11 mai 2016 16:25
À : users@wicket.apache.org
Objet : wicket-async-task

Hello,


When loading data from database, I would like to create my own (textual) 
progression bar. I create a small code (from World Clock 
Example) that uses ajax. 
The code does not work. In fact, the wicket renderer does not nothing, it waits 
the end of dowloading information from the database. When all data are 
available, the  progress bar works !


Therefore, I create a thread to download the data, but the behavior is the 
same. Nothing happens until the end of datadowloading.


How to do thread in wicket ?

Is there a new implementation of  https://github.com/raphw/wicket-async-task ?

The code was built in 2013!

What is the best way to do thread in wicket ? Does wicket have built-in 
capabilities to manage asynchronous tasks ?


Thanks,

PHL.

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



Re: wicket-async-task

2016-05-11 Thread Sebastien
Hi,

If you would like to try out async websockets, here is some pointers:

https://github.com/sebfz1/wicket-quickstart-cdi-async (uses notifications,
but progressbar would work the same)
https://github.com/cat1000/FutureProgressBar

Best regards,
Sebastien.


On Wed, May 11, 2016 at 6:33 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> maybe the progress bar I build helps you a bit:
>
>
> https://github.com/klopfdreh/wicket-components-playground/wiki/12.-HTML5-Progress
>
>
> https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/wicketstuff/html5/progress/Progress.java
>
> But I think the better solution is to use websockets
>
> kind regards
>
> Tobias
>
> > Am 11.05.2016 um 18:25 schrieb andre seame :
> >
> > Hello,
> >
> >
> > When loading data from database, I would like to create my own (textual)
> progression bar. I create a small code (from World Clock Example<
> http://examples7x.wicket.apache.org/ajax/world-clock>) that uses ajax.
> The code does not work. In fact, the wicket renderer does not nothing, it
> waits the end of dowloading information from the database. When all data
> are available, the  progress bar works !
> >
> >
> > Therefore, I create a thread to download the data, but the behavior is
> the same. Nothing happens until the end of datadowloading.
> >
> >
> > How to do thread in wicket ?
> >
> > Is there a new implementation of
> https://github.com/raphw/wicket-async-task ?
> >
> > The code was built in 2013!
> >
> > What is the best way to do thread in wicket ? Does wicket have built-in
> capabilities to manage asynchronous tasks ?
> >
> >
> > Thanks,
> >
> > PHL.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: wicket-async-task

2016-05-11 Thread Tobias Soloschenko
Hi,

maybe the progress bar I build helps you a bit:

https://github.com/klopfdreh/wicket-components-playground/wiki/12.-HTML5-Progress

https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/wicketstuff/html5/progress/Progress.java

But I think the better solution is to use websockets

kind regards

Tobias

> Am 11.05.2016 um 18:25 schrieb andre seame :
> 
> Hello,
> 
> 
> When loading data from database, I would like to create my own (textual) 
> progression bar. I create a small code (from World Clock 
> Example) that uses 
> ajax. The code does not work. In fact, the wicket renderer does not nothing, 
> it waits the end of dowloading information from the database. When all data 
> are available, the  progress bar works !
> 
> 
> Therefore, I create a thread to download the data, but the behavior is the 
> same. Nothing happens until the end of datadowloading.
> 
> 
> How to do thread in wicket ?
> 
> Is there a new implementation of  https://github.com/raphw/wicket-async-task ?
> 
> The code was built in 2013!
> 
> What is the best way to do thread in wicket ? Does wicket have built-in 
> capabilities to manage asynchronous tasks ?
> 
> 
> Thanks,
> 
> PHL.

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



wicket-async-task

2016-05-11 Thread andre seame
Hello,


When loading data from database, I would like to create my own (textual) 
progression bar. I create a small code (from World Clock 
Example) that uses ajax. 
The code does not work. In fact, the wicket renderer does not nothing, it waits 
the end of dowloading information from the database. When all data are 
available, the  progress bar works !


Therefore, I create a thread to download the data, but the behavior is the 
same. Nothing happens until the end of datadowloading.


How to do thread in wicket ?

Is there a new implementation of  https://github.com/raphw/wicket-async-task ?

The code was built in 2013!

What is the best way to do thread in wicket ? Does wicket have built-in 
capabilities to manage asynchronous tasks ?


Thanks,

PHL.


Re: when a Form validation fails, components don't refresh correctly

2016-05-11 Thread Sven Meier

Hi,

calling myTextField.clearInput() would be the recommended solution.

Have fun
Sven


On 11.05.2016 17:31, marco di gasbarro wrote:

Hey All,
I'm dealing with a user interaction problem after a failed Form validation.
In fact I have a Form with two components: a DropDownChoice and a TextField.
The DropDownChoice has an AjaxFormComponentUpdatingBehavior attached, which
modifies the TextField's model object and then adds the TextField itself to
the AjaxRequestTarget.

When the Form validation fails, the DropDown's Behavior changes the
TextField's underlying model object correctly, adds the TextField to the
Target, but the TextField renders with the old converted input, which
doesn't reflect the changes.

If on the one hand it looks like a Wicket's feature to leave the Form
components showing the input which couldn't be validated, on the other hand
a flexible user interaction should let the component to be notified about
the changes occurred on its model object.

By now I work around it calling inputChanged() on the TextField before
adding it to the Target.
Is there any best practice which covers this use case?

Here is a snippet:

new AjaxFormComponentUpdatingBehavior("change"){
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 //update the TextField model object

getMyFormModelObject().setMyTextFieldModelObject(newValue);
 //temporary workaround
 myTextField.inputChanged();
 //add the textfield to the Target
 target.add(myTextField);
  }
}


Thanks in advance for your help!
--
Marco




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



when a Form validation fails, components don't refresh correctly

2016-05-11 Thread marco di gasbarro
Hey All,
I'm dealing with a user interaction problem after a failed Form validation.
In fact I have a Form with two components: a DropDownChoice and a TextField.
The DropDownChoice has an AjaxFormComponentUpdatingBehavior attached, which
modifies the TextField's model object and then adds the TextField itself to
the AjaxRequestTarget.

When the Form validation fails, the DropDown's Behavior changes the
TextField's underlying model object correctly, adds the TextField to the
Target, but the TextField renders with the old converted input, which
doesn't reflect the changes.

If on the one hand it looks like a Wicket's feature to leave the Form
components showing the input which couldn't be validated, on the other hand
a flexible user interaction should let the component to be notified about
the changes occurred on its model object.

By now I work around it calling inputChanged() on the TextField before
adding it to the Target.
Is there any best practice which covers this use case?

Here is a snippet:

new AjaxFormComponentUpdatingBehavior("change"){
@Override
protected void onUpdate(AjaxRequestTarget target) {
//update the TextField model object

getMyFormModelObject().setMyTextFieldModelObject(newValue);
//temporary workaround
myTextField.inputChanged();
//add the textfield to the Target
target.add(myTextField);
 }
}


Thanks in advance for your help!
--
Marco


Re: Easy way to have a progression bar during repeater

2016-05-11 Thread Ernesto Reinaldo Barreiro
Oops...

https://gist.github.com/robmcguinness/706011

On Wed, May 11, 2016 at 3:20 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Something similar to
>
> https://gist.github.com/robmcguinness/70601
>
> On Wed, May 11, 2016 at 3:05 PM, andre seame  wrote:
>
>> Hello,
>>
>>
>> In first approximation, inDataTableFilterToolbarPage the code is :
>>
>> 1) Get Data from "external Database" (in fact, the example build more or
>> less random data) and put in  memory list
>>
>> 2) Use repeater wicket code to display the list to the end user.
>>
>>
>> Therefore the Wicket Html is just :
>>
>> [table]
>>
>>
>> In my case, the reading of the database is very slow (2 to 5 minuts). Of
>> course the idea is to do some optimization, but I would like present a
>> progression bar to the End user.
>>
>>
>> How to do that ?
>>
>> 1) Create a Popup ? Is it possible to create a popup that will disappear
>> at the end of progression ?
>>
>> 2) Adding a waiting page that will call my "old wicket code" (so use the
>> page with the > wicket:id="tableWithFilterForm">[table])
>>
>> 3) Design the page to have 2 components : 1 waiting component and 1 table
>> dataview component ?
>>
>>
>> How to do that : Ajax code ? Java Thread ?
>>
>>
>> Is there any pointer in the wicket example ?
>>
>>
>> Thanks,
>>
>> PHL.
>>
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: Easy way to have a progression bar during repeater

2016-05-11 Thread Ernesto Reinaldo Barreiro
Something similar to

https://gist.github.com/robmcguinness/70601

On Wed, May 11, 2016 at 3:05 PM, andre seame  wrote:

> Hello,
>
>
> In first approximation, inDataTableFilterToolbarPage the code is :
>
> 1) Get Data from "external Database" (in fact, the example build more or
> less random data) and put in  memory list
>
> 2) Use repeater wicket code to display the list to the end user.
>
>
> Therefore the Wicket Html is just :
>
> [table]
>
>
> In my case, the reading of the database is very slow (2 to 5 minuts). Of
> course the idea is to do some optimization, but I would like present a
> progression bar to the End user.
>
>
> How to do that ?
>
> 1) Create a Popup ? Is it possible to create a popup that will disappear
> at the end of progression ?
>
> 2) Adding a waiting page that will call my "old wicket code" (so use the
> page with the  wicket:id="tableWithFilterForm">[table])
>
> 3) Design the page to have 2 components : 1 waiting component and 1 table
> dataview component ?
>
>
> How to do that : Ajax code ? Java Thread ?
>
>
> Is there any pointer in the wicket example ?
>
>
> Thanks,
>
> PHL.
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: [wicketstuff-restannotations] AbstractRestResource.toObject makes it impossible for mapped methods to know a parameter conversion went wrong.

2016-05-11 Thread Andrea Del Bene

You're welcome!

On 10/05/2016 15:06, Fabio Fioretti wrote:

I confirm version 6.23.0 fixed the problem.

Thank you for the great support!

Kind regards,
Fabio

On Thu, Apr 28, 2016 at 12:02 PM, Fabio Fioretti <
windom.macroso...@gmail.com> wrote:


Thanks Andrea, that would be excellent!

Keep up the great work,
Fabio

On Thu, Apr 28, 2016 at 11:52 AM, Andrea Del Bene 
wrote:


Thank you for the issue! I think we can make it for next release 6.23.0
which should come quite soon (at the moment we are voting to release Wicket
6.23.0).

Andrea.


On 28/04/2016 11:34, Fabio Fioretti wrote:


Done: https://github.com/wicketstuff/core/issues/490

Many thanks,
Fabio

On Thu, Apr 28, 2016 at 11:03 AM, Martin Grigorov <
martin.grigo...@gmail.com


wrote:
Please file an issue at Wicketstuff GibHub.
On Apr 28, 2016 10:31 AM, "Fabio Fioretti"  wrote:

Hi all,

Please consider the following simple implementation of


AbstractRestResource


(6.22.0):

@ResourcePath("/rest/api")
public class MyRestResource extends
AbstractRestResource
{

   public MyRestResource ()
   {
super(new JsonWebSerialDeserial(new GsonObjectSerialDeserial()));
   }

   @MethodMapping(value = "/offices")
   public List findOffices(
 @RequestParam(value = "region", required = false) Integer


regionId)

   {

return findOfficesByRegion(regionId);
   }
}

My question relates to the findOffices method and its filtering


regionId
parameter when the value is not a valid integer. For example,
consider

the

request 'GET /rest/api/offices?region=AA'.

At the second step of AbstractRestResource.handleMethodExecution,
extractMethodParameters is invoked, which in turn triggers the


conversion
of all parameters through the static method toObject.

When the conversion goes wrong and ConversionException is thrown,


toObject


catches it, sets the response status to 400 and returns null!

Now, when my findOffices is finally executed, I get a null regionId


but I
don't know whether it was not valid or the parameter was not present
at

all. Checking the response status downstream is also particularly

hard

because I have no getStatus (Tomcat 6 here, ouch!).

To my mind, findOffices should return null instead of the unfiltered


list
of offices if the conversion went wrong, even because the response

status is 400 (as set by toObject). However, how can I know it?

Any suggestions?

IMO this is a bug in the library.

#findOffices() should not be executed at all.
A response with status code 400 should be returned immediately after


the
unsuccessful convention without giving a chance to the application code
to


be executed.

Many thanks,

Fabio



-
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



Easy way to have a progression bar during repeater

2016-05-11 Thread andre seame
Hello,


In first approximation, inDataTableFilterToolbarPage the code is :

1) Get Data from "external Database" (in fact, the example build more or less 
random data) and put in  memory list

2) Use repeater wicket code to display the list to the end user.


Therefore the Wicket Html is just :

[table]


In my case, the reading of the database is very slow (2 to 5 minuts). Of course 
the idea is to do some optimization, but I would like present a progression bar 
to the End user.


How to do that ?

1) Create a Popup ? Is it possible to create a popup that will disappear at the 
end of progression ?

2) Adding a waiting page that will call my "old wicket code" (so use the page 
with the [table])

3) Design the page to have 2 components : 1 waiting component and 1 table 
dataview component ?


How to do that : Ajax code ? Java Thread ?


Is there any pointer in the wicket example ?


Thanks,

PHL.


Re: Which model to use for forwarding form processing results?

2016-05-11 Thread Thorsten Schöning
Guten Tag Bas Gooren,
am Dienstag, 10. Mai 2016 um 20:48 schrieben Sie:

> Yes, that is normal behavior I think - for invisible components we
> either wrap it in a container which receives the event, or let the page be 
> the coordinator.

I found overriding Component.canCallListenerInterface easier to
maintain and suggested an improvement to the dispatcher:

https://github.com/wicketstuff/core/issues/493

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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