Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Ernesto Reinaldo Barreiro
By the way I already integrated BootstrapFileInput into my application and
it works fine with wicket AJAX.

On Sat, Jun 20, 2015 at 8:26 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> I have the code locally... I will have a look. Thanks again.
>
> On Sat, Jun 20, 2015 at 8:23 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
>> Hi,
>>
>> the component belongs to wicket bootstrap extensions and is rather new. I
>> don't know much about the release of:
>>
>> http://wb.agilecoders.de/demo/extensions
>>
>> but there it should be.
>>
>> @Martin: is there a way to release the current version so that Ernesto
>> can see the dropzone upload in action?
>>
>> Otherwise you can checkout the git repo and run it local.
>>
>> kind regards
>>
>> Tobias
>>
>> > Am 20.06.2015 um 07:16 schrieb Ernesto Reinaldo Barreiro <
>> reier...@gmail.com>:
>> >
>> > @Tobias
>> >
>> > Thanks! Any place where I can wee this component in action?
>> >
>> > On Sat, Jun 20, 2015 at 3:29 AM, Tobias Soloschenko <
>> > tobiassolosche...@googlemail.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> Just want to mention here:
>> >>
>> >>
>> https://github.com/klopfdreh/wicket-components-playground/wiki/15.-DropZoneFileUpload
>> >>
>> >>
>> >>
>> https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/ExtensionsPage.java#L180
>> >>
>> >> kind regards
>> >>
>> >> Tobias
>> >>
>>  Am 19.06.2015 um 17:49 schrieb Ernesto Reinaldo Barreiro <
>> >>> reier...@gmail.com>:
>> >>>
>> >>> Hi Martin,
>> >>>
>> >>> Thanks!
>> >>>
>> >>> Seems so by the examples... I'll give it a try soon.
>> >>>
>> >>> On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov <
>> mgrigo...@apache.org>
>> >>> wrote:
>> >>>
>>  Hi Ernesto,
>> 
>>  AFAIK - yes.
>> 
>>  Martin Grigorov
>>  Freelancer. Available for hire!
>>  Wicket Training and Consulting
>>  https://twitter.com/mtgrigorov
>> 
>>  On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
>>  reier...@gmail.com> wrote:
>> 
>> > Hi,
>> >
>> > Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
>> >
>> > --
>> > Regards - Ernesto Reinaldo Barreiro
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Regards - Ernesto Reinaldo Barreiro
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>> > --
>> > Regards - Ernesto Reinaldo Barreiro
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Ernesto Reinaldo Barreiro
I have the code locally... I will have a look. Thanks again.

On Sat, Jun 20, 2015 at 8:23 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> the component belongs to wicket bootstrap extensions and is rather new. I
> don't know much about the release of:
>
> http://wb.agilecoders.de/demo/extensions
>
> but there it should be.
>
> @Martin: is there a way to release the current version so that Ernesto can
> see the dropzone upload in action?
>
> Otherwise you can checkout the git repo and run it local.
>
> kind regards
>
> Tobias
>
> > Am 20.06.2015 um 07:16 schrieb Ernesto Reinaldo Barreiro <
> reier...@gmail.com>:
> >
> > @Tobias
> >
> > Thanks! Any place where I can wee this component in action?
> >
> > On Sat, Jun 20, 2015 at 3:29 AM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> Just want to mention here:
> >>
> >>
> https://github.com/klopfdreh/wicket-components-playground/wiki/15.-DropZoneFileUpload
> >>
> >>
> >>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/ExtensionsPage.java#L180
> >>
> >> kind regards
> >>
> >> Tobias
> >>
>  Am 19.06.2015 um 17:49 schrieb Ernesto Reinaldo Barreiro <
> >>> reier...@gmail.com>:
> >>>
> >>> Hi Martin,
> >>>
> >>> Thanks!
> >>>
> >>> Seems so by the examples... I'll give it a try soon.
> >>>
> >>> On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov  >
> >>> wrote:
> >>>
>  Hi Ernesto,
> 
>  AFAIK - yes.
> 
>  Martin Grigorov
>  Freelancer. Available for hire!
>  Wicket Training and Consulting
>  https://twitter.com/mtgrigorov
> 
>  On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
>  reier...@gmail.com> wrote:
> 
> > Hi,
> >
> > Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >>>
> >>>
> >>>
> >>> --
> >>> Regards - Ernesto Reinaldo Barreiro
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Tobias Soloschenko
Hi,

the component belongs to wicket bootstrap extensions and is rather new. I don't 
know much about the release of:

http://wb.agilecoders.de/demo/extensions

but there it should be.

@Martin: is there a way to release the current version so that Ernesto can see 
the dropzone upload in action?

Otherwise you can checkout the git repo and run it local.

kind regards

Tobias

> Am 20.06.2015 um 07:16 schrieb Ernesto Reinaldo Barreiro :
> 
> @Tobias
> 
> Thanks! Any place where I can wee this component in action?
> 
> On Sat, Jun 20, 2015 at 3:29 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> Just want to mention here:
>> 
>> https://github.com/klopfdreh/wicket-components-playground/wiki/15.-DropZoneFileUpload
>> 
>> 
>> https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/ExtensionsPage.java#L180
>> 
>> kind regards
>> 
>> Tobias
>> 
 Am 19.06.2015 um 17:49 schrieb Ernesto Reinaldo Barreiro <
>>> reier...@gmail.com>:
>>> 
>>> Hi Martin,
>>> 
>>> Thanks!
>>> 
>>> Seems so by the examples... I'll give it a try soon.
>>> 
>>> On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov 
>>> wrote:
>>> 
 Hi Ernesto,
 
 AFAIK - yes.
 
 Martin Grigorov
 Freelancer. Available for hire!
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
 reier...@gmail.com> wrote:
 
> Hi,
> 
> Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
> 
> --
> Regards - Ernesto Reinaldo Barreiro
>>> 
>>> 
>>> 
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro

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



Re: AjaxButton abstract

2015-06-19 Thread Ernesto Reinaldo Barreiro
Saturday mornings :-( What's the reasoning behind

https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java

being abstract? It does not forces you to override any methods :-)

 form.add(new AjaxButton("save") {


})


On Sat, Jun 20, 2015 at 7:45 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> What the reasoning behind
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro


AjaxButton abstract

2015-06-19 Thread Ernesto Reinaldo Barreiro
Hi,

What the reasoning behind


-- 
Regards - Ernesto Reinaldo Barreiro


Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Ernesto Reinaldo Barreiro
@Tobias

Thanks! Any place where I can wee this component in action?

On Sat, Jun 20, 2015 at 3:29 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> Just want to mention here:
>
> https://github.com/klopfdreh/wicket-components-playground/wiki/15.-DropZoneFileUpload
>
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/ExtensionsPage.java#L180
>
> kind regards
>
> Tobias
>
> > Am 19.06.2015 um 17:49 schrieb Ernesto Reinaldo Barreiro <
> reier...@gmail.com>:
> >
> > Hi Martin,
> >
> > Thanks!
> >
> > Seems so by the examples... I'll give it a try soon.
> >
> > On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov 
> > wrote:
> >
> >> Hi Ernesto,
> >>
> >> AFAIK - yes.
> >>
> >> Martin Grigorov
> >> Freelancer. Available for hire!
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
> >> reier...@gmail.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
> >>>
> >>> --
> >>> Regards - Ernesto Reinaldo Barreiro
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Webpage does not refresh when ListView is based on a List supplied by a database

2015-06-19 Thread Ernesto Reinaldo Barreiro
Listview might be chancing your List? Use instead an LDM that always fetch
fresh copy of the List...

On Fri, Jun 19, 2015 at 9:03 PM, Ulrich  wrote:

> Want to refresh page and show curently added entry to database. But does
> not
> work. To trap down the reason I've created two applications which are very
> similiar. Both show a java.util.List - on is filled from a database the
> other one immediately from the program (List.add()). The second
> one is fine, the first one is in no way dynamic; even Browser refresh does
> not display the new entry; I have to call the whole URL again.
>
> What is wrong with my assumptions. Any hint is appreciated.
>
> brgds
> Ulrich
>
> *Database-Sample:*
> package com.mycompany;
>
> import java.io.IOException;
> import java.util.Date;
> import java.util.List;
>
> import org.apache.wicket.request.mapper.parameter.PageParameters;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.form.AjaxButton;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.markup.html.list.ListItem;
> import org.apache.wicket.markup.html.list.ListView;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.model.Model;
> import org.apache.wicket.model.PropertyModel;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> import de.gombers.accounts.dao.mybatis.ListData;
> import de.gombers.accounts.dao.mybatis.ListDataDAO;
>
>
> public class HomePage extends WebPage {
> private static final Logger LOGGER =
> LoggerFactory.getLogger(HomePage.class);
> private static final long serialVersionUID = 1L;
> private List dataList;
>
> public HomePage(final PageParameters parameters) {
> super(parameters);
>
> Form form = new Form("form");
>
> PropertyModel pm = new PropertyModel(this, "dataList");
> List werte = (List) pm.getObject();
>
>
>
> final ListView listView =  new ListView("listentries",
> werte ) {
> @Override
> protected void populateItem(ListItem item) {
> final ListData data=  (ListData)
> item.getModelObject();
> item.add(new Label("mydate", new Model() {
> @Override
> public String getObject() {
> return
> data.getMyDate().toString();
> }
> }));
> item.add(new Label("mytext", new Model(""){
> @Override
> public String getObject() {
> return data.getMyText();
> }
> }));
>
> }
> };
> listView.setOutputMarkupId(true);
> form.add(listView);
>
>
> AjaxButton submit = new AjaxButton("addEntry"){
> @Override
> protected  void onSubmit(AjaxRequestTarget
> target, Form form) {
> ListData data = new ListData();
> data.setMyData(new Date());
> data.setMyText("myText");;
> try {
> new
> ListDataDAO().insertNewEntry(data);
> } catch (IOException e) {
> // TODO Auto-generated catch block
> //
>   e.printStackTrace();
> }
> try {
> dataList=new
> ListDataDAO().getAllData();
> } catch (IOException e) {
> LOGGER.error("", e);
> }
>
> target.add(form);
> }
> };
>
> form.add(submit);
> add(form);
> }
>
> public List getDataList() {
> try {
> dataList=new ListDataDAO().getAllData();
> LOGGER.info("ListDataSize2={}", dataList.size());
> } catch (IOException e) {
> LOGGER.error("", e);
> }
> return dataList;
> }
> }
>
> *ListArray-Sample:*
> package com.mycompany;
>
> import java.io.IOException;
> import java.util.ArrayList;
> import java.util.Date;
> import java.util.List;
>
> import org.apache.wicket.request.mapper.parameter.PagePara

Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Tobias Soloschenko
Hi,

Just want to mention here:
https://github.com/klopfdreh/wicket-components-playground/wiki/15.-DropZoneFileUpload

https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/master/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/pages/ExtensionsPage.java#L180

kind regards

Tobias

> Am 19.06.2015 um 17:49 schrieb Ernesto Reinaldo Barreiro :
> 
> Hi Martin,
> 
> Thanks!
> 
> Seems so by the examples... I'll give it a try soon.
> 
> On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov 
> wrote:
> 
>> Hi Ernesto,
>> 
>> AFAIK - yes.
>> 
>> Martin Grigorov
>> Freelancer. Available for hire!
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>> Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
>>> 
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
> 
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro

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



Re: Webpage does not refresh when ListView is based on a List supplied by a database

2015-06-19 Thread Sebastien
Hi,

> PropertyModel pm = new PropertyModel(this, "dataList");
> List werte = (List) pm.getObject();
> final ListView listView =  new ListView("listentries", werte )

You need to pass a model to the list view:
final ListView listView =  new ListView("listentries", new
PropertyModel(this, "dataList"))

Also please note that you should avoid unwraping a model (calling
#getObject) in the constructor...

Hope this helps,
Sebastien.


On Fri, Jun 19, 2015 at 9:03 PM, Ulrich  wrote:

> Want to refresh page and show curently added entry to database. But does
> not
> work. To trap down the reason I've created two applications which are very
> similiar. Both show a java.util.List - on is filled from a database the
> other one immediately from the program (List.add()). The second
> one is fine, the first one is in no way dynamic; even Browser refresh does
> not display the new entry; I have to call the whole URL again.
>
> What is wrong with my assumptions. Any hint is appreciated.
>
> brgds
> Ulrich
>
> *Database-Sample:*
> package com.mycompany;
>
> import java.io.IOException;
> import java.util.Date;
> import java.util.List;
>
> import org.apache.wicket.request.mapper.parameter.PageParameters;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.form.AjaxButton;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.markup.html.list.ListItem;
> import org.apache.wicket.markup.html.list.ListView;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.model.Model;
> import org.apache.wicket.model.PropertyModel;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> import de.gombers.accounts.dao.mybatis.ListData;
> import de.gombers.accounts.dao.mybatis.ListDataDAO;
>
>
> public class HomePage extends WebPage {
> private static final Logger LOGGER =
> LoggerFactory.getLogger(HomePage.class);
> private static final long serialVersionUID = 1L;
> private List dataList;
>
> public HomePage(final PageParameters parameters) {
> super(parameters);
>
> Form form = new Form("form");
>
> PropertyModel pm = new PropertyModel(this, "dataList");
> List werte = (List) pm.getObject();
>
>
>
> final ListView listView =  new ListView("listentries",
> werte ) {
> @Override
> protected void populateItem(ListItem item) {
> final ListData data=  (ListData)
> item.getModelObject();
> item.add(new Label("mydate", new Model() {
> @Override
> public String getObject() {
> return
> data.getMyDate().toString();
> }
> }));
> item.add(new Label("mytext", new Model(""){
> @Override
> public String getObject() {
> return data.getMyText();
> }
> }));
>
> }
> };
> listView.setOutputMarkupId(true);
> form.add(listView);
>
>
> AjaxButton submit = new AjaxButton("addEntry"){
> @Override
> protected  void onSubmit(AjaxRequestTarget
> target, Form form) {
> ListData data = new ListData();
> data.setMyData(new Date());
> data.setMyText("myText");;
> try {
> new
> ListDataDAO().insertNewEntry(data);
> } catch (IOException e) {
> // TODO Auto-generated catch block
> //
>   e.printStackTrace();
> }
> try {
> dataList=new
> ListDataDAO().getAllData();
> } catch (IOException e) {
> LOGGER.error("", e);
> }
>
> target.add(form);
> }
> };
>
> form.add(submit);
> add(form);
> }
>
> public List getDataList() {
> try {
> dataList=new ListDataDAO().getAllData();
> LOGGER.info("ListDataSize2={}", dataList.size());
> } catch (IOException e) {
>

Wicket jQuery UI 6.20.0 pre-release

2015-06-19 Thread Sebastien
Dear wicket-jquery-ui users,

Wicket jQuery UI 6.20.0 based on Apache Wicket 6.20.0 is now pre-released.

A pre-release means that it is available trough the oss sonatype staging
repository only, the aim is to have a chance to test the release before it
becomes definitive and pushed at maven central.

This version comes with a significant amount of changes, including some API
breaks.
It is highly recommended to read the changelog:
https://github.com/sebfz1/wicket-jquery-ui/releases/tag/wicket-jquery-ui-6.20.0

*Staging Repository*



sonatype-releases
Sonatype Releases Repository

https://oss.sonatype.org/content/repositories/comgooglecodewicket-jquery-ui-1019




*Maven dependencies*

Wicket jQuery UI


com.googlecode.wicket-jquery-ui
wicket-jquery-ui
6.20.0


Wicket Kendo UI


com.googlecode.wicket-jquery-ui
wicket-kendo-ui
6.20.0


Should you notice any issue/regression, please open an issue:
https://github.com/sebfz1/wicket-jquery-ui/issues

Feedbacks & votes are welcome!

Thanks in advance & enjoy,
Sebastien
http://www.7thweb.net/wicket-jquery-ui/


Webpage does not refresh when ListView is based on a List supplied by a database

2015-06-19 Thread Ulrich
Want to refresh page and show curently added entry to database. But does not
work. To trap down the reason I've created two applications which are very
similiar. Both show a java.util.List - on is filled from a database the
other one immediately from the program (List.add()). The second
one is fine, the first one is in no way dynamic; even Browser refresh does
not display the new entry; I have to call the whole URL again.

What is wrong with my assumptions. Any hint is appreciated.

brgds
Ulrich

*Database-Sample:*
package com.mycompany;

import java.io.IOException;
import java.util.Date;
import java.util.List;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.gombers.accounts.dao.mybatis.ListData;
import de.gombers.accounts.dao.mybatis.ListDataDAO;


public class HomePage extends WebPage {
private static final Logger LOGGER =
LoggerFactory.getLogger(HomePage.class);
private static final long serialVersionUID = 1L;
private List dataList;

public HomePage(final PageParameters parameters) {
super(parameters);

Form form = new Form("form");

PropertyModel pm = new PropertyModel(this, "dataList");
List werte = (List) pm.getObject();



final ListView listView =  new ListView("listentries", werte ) {
@Override
protected void populateItem(ListItem item) {
final ListData data=  (ListData) 
item.getModelObject();
item.add(new Label("mydate", new Model() {
@Override
public String getObject() {
return 
data.getMyDate().toString();
}
}));
item.add(new Label("mytext", new Model(""){
@Override
public String getObject() {
return data.getMyText();
}
}));

}
};
listView.setOutputMarkupId(true);
form.add(listView);


AjaxButton submit = new AjaxButton("addEntry"){
@Override
protected  void onSubmit(AjaxRequestTarget 
target, Form form) {
ListData data = new ListData();
data.setMyData(new Date());
data.setMyText("myText");;
try {
new ListDataDAO().insertNewEntry(data);
} catch (IOException e) {
// TODO Auto-generated catch block
//  
e.printStackTrace();
}
try {
dataList=new ListDataDAO().getAllData();
} catch (IOException e) {
LOGGER.error("", e);
}

target.add(form);
}
};

form.add(submit);
add(form);
}

public List getDataList() {
try {
dataList=new ListDataDAO().getAllData();
LOGGER.info("ListDataSize2={}", dataList.size());
} catch (IOException e) {
LOGGER.error("", e);
}
return dataList;
}
}

*ListArray-Sample:*
package com.mycompany;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.

Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Ernesto Reinaldo Barreiro
Hi Martin,

Thanks!

Seems so by the examples... I'll give it a try soon.

On Fri, Jun 19, 2015 at 5:46 PM, Martin Grigorov 
wrote:

> Hi Ernesto,
>
> AFAIK - yes.
>
> Martin Grigorov
> Freelancer. Available for hire!
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Martin Grigorov
Hi Ernesto,

AFAIK - yes.

Martin Grigorov
Freelancer. Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Jun 19, 2015 at 6:30 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


does BootstrapFileInput plays nicely with Wicket AJAX file upload?

2015-06-19 Thread Ernesto Reinaldo Barreiro
Hi,

Does BootstrapFileInput plays nicely with Wicket "AJAX" file upload?

-- 
Regards - Ernesto Reinaldo Barreiro


Re: Wicket 6 + string resource caching

2015-06-19 Thread Tobias Gierke

Thanks Martin & Sven, works like a charm :)

Cheers,
Tobias


Also see Localizer#clearCache() [1]
When changing the theme use getApplication().getLocalizer().clearCache()

1.
https://github.com/apache/wicket/blob/edcbd4e849378a5aba9ee2d5e4f954bce904af52/wicket-core/src/main/java/org/apache/wicket/Localizer.java#L90

Martin Grigorov
Freelancer. Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jun 18, 2015 at 9:14 PM, Sven Meier  wrote:


Hi,

Wicket includes the session's style when generating the cache key*. Why
don't you use this to identify your current 'theme'? Then theme-specific
string resources should work out-of-the-box.

Have fun
Sven

*See Localizer#getCacheKey()



On 18.06.2015 16:39, Tobias Gierke wrote:


Hi,

I'm working on a 'themeable' (does this word exist ?) application were
some string resources differ based on the currently active user's theme.
Since (at least during development) each user can freely switch between
different themes, I need Wicket to not cache these string resources.

I implemented a custom IStringResourceLoader to locate the .properties
file associated with the current user's UI theme but it seems Wicket is
caching the String property values and only calls my IStringResourceLoader
once for every String property.

How can I disable this caching for my IStringResourceLoader ? I suspect
Wicket thinks of .properties files as static resources so maybe I'm
stretching the design a bit ;)

Cheers,
Tobias


Currently my WicketApplication class looks like this:

--->8-->8-->8-->8-->8-->8---
 getResourceSettings().getStringResourceLoaders().add( new
UIThemeStringResourceLoader() );
--->8-->8-->8-->8-->8-->8---

...and the the IStringResourceLoader looks like this

--->8-->8-->8-->8-->8-->8---
 protected final class UIThemeStringResourceLoader implements
IStringResourceLoader
 {
 // cache to avoid reloading properties over and over when not in
debug mode
 private final Map properties = new
HashMap<>(); // Key is UI theme name, value is properties file

 @Override
 public String loadStringResource(Class clazz, String key,
Locale locale, String style, String variation)
 {
 return loadStringResource( (Component) null , key  , locale
,style , variation );
 }

 @Override
 public String loadStringResource(Component component, String key,
Locale locale, String style, String variation)
 {
 synchronized( properties )
 {
 CacheEntry props = properties.get( getUITheme().getName()
);
 if ( props == null || ( isDebugModeEnabled() &&
props.isOlderThan( java.time.Duration.ofSeconds( 2 ) ) ) ) // discard stale
properties when running in debug mode
 {
 final UserSession session = (UserSession)
Session.get();
 final Locale locale = session.isUserLoggedIn() ?
session.getCurrentUser().getLocale() :
applicationSettings.getDefaultLocale();
 final String path =
getUITheme().getStringPropertiesPath( locale );

 try ( final InputStream stream =
getServletContext().getResourceAsStream( path ) )
 {
 if ( stream == null ) {
 return null;
 }

 final Properties tmp = new Properties();
 tmp.load( stream );

 props = new CacheEntry( tmp );
 properties.put( getUITheme().getName() , props );
 }
 catch (IOException e) {
 LOG.warn("getString(): Failed to load string
properties for UI theme '"+getUITheme().getName()+"' from '"+path+"'",e);
 }
 }
 return props.properties.getProperty( key );
 }
 }
 }



-
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: Dealing with transient and persistent objects in Wicket sessions and models

2015-06-19 Thread Urbani, Edmund

On 06/19/2015 01:59 AM, wix wrote:

Urbani, Edmund wrote

I don't think I am the only one running into these kinds of issues, so I'd
like
to hear which patterns other developers apply or what they consider best
practices.

  Would like to hear the same. I've attempted to work through this in the
most Wicket-way I know how.

  The approach so far is a kind of LoadableDetachableModel that tries to be
smart about the persistent state of the underlying entity/object. A
persistence provider (entitymanager or such) would be injected into the
model or requested by the model, and a flag or flags used to track the state
of the underlying entity - is the entity currently managed? is the entity to
be retained (that is, not automatically detached)? is the entity currently
attached?

  So at the start of a wizard, the model is given a new entity and told that
it is un-managed and retained. As the model is passed to the next page or to
a previous page, the entity is serialized (not detached) and treated as
though it doesn't belong to a persistence context. At the end of the wizard
the model is told to persist the entity at which time it becomes managed but
not retained (so it detaches, and would be re-attached via persistence id
lookup when the model is next deserialized/loaded).

  A wizard or other set of pages working with an existing entity that was
selected from persistence just tells the model that it is managed and
retained. Then the model still doesn't "detach" in the sense of setting the
underlying entity to null, but it does "detach" from the JPA context and is
safely(?) serialized. Thereby changes made in wizard pages ride along to the
end as in the new entity case above, and aren't merged til whatever final
page/part logic says so. Cancelling out in the middle is simple since no
changed would have been persisted.

  It works for any generic entity in my projects so far, however my use case
right now isn't complicated by multi-entity editing; only one entity (one
model's underlying object) is being modified by a single form submission in
the open-session-in-view cycle.

  If there are other drawbacks to this approach or a better way (a more
Wicket-way)...
Detaching from Hibernate / JPA session as you describe is another way to handle 
this. Makes me worry about concurrent modifications which might be committed in 
between detaching from / re-attaching to the persistence layer though.


Also, I have considered separating the presentation layer (Wicket) from the 
managed database objects entirely and handle every interaction with the database 
through a service layer which maps database objects to/from a different set of 
classes tailored specifically for the UI and its various use cases. That would 
be the "cleanest" approach I can think of, and also the most expensive one to 
implement.


However, currently I am trying to hook into the serialization process to 
untangle my partially persistent object graph as described in this article:

http://techblog.molindo.at/2009/03/detaching-and-attaching-persistent-objects-on-serialization.html

This seems to be working so far (pending some thorough testing) even though it 
causes some weird exceptions in unit tests (javassist.CannotCompileException), 
which I have yet to fix.


--

Mit freundlichen Grüßen
Edmund Urbani
Liland IT Team

Email: edmund.urb...@lilandit.com 

Liland IT GmbH ...does IT better
Tel: +43 463 220111
Fax: +43 463 220111-33
Tel(GER): +49 221 65028588

Find us at Facebook http://facebook.com/Lilandit
http://green-badges.com
http://iventcloud.com
http://Lilandit.com

 

Copyright © 2015, Liland IT GmbH

Diese Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese Email irrtuemlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.


This email may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this email in error) 
please notify the sender immediately and destroy this email. Any unauthorised 
copying, disclosure or distribution of the material in this email is strictly 
forbidden.