Re: java.util.Properties as Form Model

2013-10-18 Thread Andy Van Den Heuvel
This indeed solves the trick. I'm not sure this is a bug, since the
propertyresolver is a general system and Hashtable is just an exception to
normal javabean rules.



On Fri, Oct 18, 2013 at 2:01 PM, Marios Skounakis  wrote:

> An idea is to wrap the Properties object in a class of your own
> implementing Map as follows:
>
> class MyProps implements Map {
>   Properties props;
>
>   public void put(String key, String value) {
> if (value == null) props.remove(key);
> else props.put(key, value);
> }
>
> This does sound like a bug in PropertyResolver as it should probably test
> whether the Map is a Hashtable and call remove() since Hashtable is
> documented to throw an NPE when put() is called with a null value.
>
>
>
> On Fri, Oct 18, 2013 at 1:55 PM, Andy Van Den Heuvel <
> andy.vandenheu...@gmail.com> wrote:
>
> > Hey,
> >
> > I'm trying to create a form with a CompoundPropertyModel to fill a
> > java.util.Properties object dynamically.
> >
> > Form form = new Form<>("form", new
> > CompoundPropertyModel<>(properties));
> > form.add(new TextField("host"));
> > form.add(new TextField("port"));
> >
> > This works correct when I start from an empty java.util.Properties
> object.
> > If I have an existing java.util.Properties object (with filled data)
> > and I remove the value in the html page, I want the key-value pair to be
> > deleted from the Properties object.
> >
> > With my current implementation I get a stacktrace (because it tries to
> > write a null value in the java.util.Properties object)
> >
> > java.lang.NullPointerException
> >  at java.util.Hashtable.put(Hashtable.java:432)
> >  at
> >
> >
> org.apache.wicket.core.util.lang.PropertyResolver$MapGetSet.setValue(PropertyResolver.java:803)
> >  at
> >
> >
> org.apache.wicket.core.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:644)
> >  at
> >
> >
> org.apache.wicket.core.util.lang.PropertyResolver.setValue(PropertyResolver.java:144)
> >
> >
> > Has anybody have an idea how best to create this behaviour?
> > Thanks in advance for your help!
> >
>


How Does Checkbox Know To Store To My Data Object

2013-10-18 Thread dhongyt
I have a Data Object called DownloadBagService which works as a place to hold
the checked files the a user selects.

I have a page that the user are able to select files from and add it to the
DownloadBagService.


When the user checks on files and hits submit. The files appear in the
DownloadBagService "magically".
As you can see my onSubmit contains code that is commented out. How does
Wicket know to put those files in the DownloadBagService?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-Does-Checkbox-Know-To-Store-To-My-Data-Object-tp4661879.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: unwanted DefaultPageManagerProvider

2013-10-18 Thread uwe schaefer

On 18.10.2013 09:03, Martin Grigorov wrote:

Hi Martin,


Can you give more details about the setup and the problem ?


of course. we use two Tomcat6 with clustering enabled (Backup-Manager) 
with apache in front using sticky sessions.


when redeploying, we restart tomcat.

Now when one tomcat is restarted and the wicket initializes, there is a 
time-window in which wicket is not yet fully initialized (and our 
DataStore is not yet set), yet the application is already bound as an 
UnbindingListener.


This is where we see sessionUnbound being called, which as i mentioned, 
causes a default datastore (disk) being wrapped in an AsyncDatastore and 
the damage is done:


Application:478
public void sessionUnbound(final String sessionId){
  internalGetPageManager().sessionExpired(sessionId);
}

Application:1387
pageManager = pageManagerProvider.get(getPageManagerContext());

DefaultPageManagerProvider:58
if (dataStore.canBeAsynchronous())
{
  int capacity = storeSettings.getAsynchronousQueueCapacity();
  dataStore = new AsynchronousDataStore(dataStore, capacity);
}

and then AsynchronousDataStore:97
pageSavingThread.start();

what other info in particular are you looking for?
i could create a quickstart and attach it to a jira issue.

cu uwe

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



Re: wicket- jqueryui Kendo DateTimePicker timePattern [RESOLVED]

2013-10-18 Thread Selom
Hello Sebastien,

I did it like this.

final DateTimePicker startDateTimePicker = new
DateTimePicker("start","dd/MM/","HH:mm"){

@Override
protected TimePicker newTimePicker(String id, 
IModel model, String
timePattern)
{
 Options options = new Options();
 
 options.set("interval",45);
 options.set("min", "new Date(2000, 0, 1, 9, 0, 
0)");
 options.set("max", "new Date(2020, 0, 1, 12, 
0, 0)");
 return new  TimePicker(id, model, timePattern,  
options);
//return new TimePicker(id, model, timePattern);
}

};

And I enjoyed.

Thank you for  you help.


Sebastien wrote
> Hi,
> 
> You can override DateTimePicker#newTimePicker
> 
> Best regards,
> Sebastien.
> 
> 
> On Fri, Oct 18, 2013 at 9:53 AM, Selom <

> pierre.kouvel@

> > wrote:
> 
>> Hi,
>> Sorry I did not explain very well my problem.
>> I am using the DateTimePicker (because i need the date ) class and there
>> no
>> constructor with such options   ?
>>
>> Thanks.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/wicket-jqueryui-Kendo-DateTimePicker-timePattern-tp4661862p4661867.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: 

> users-unsubscribe@.apache

>> For additional commands, e-mail: 

> users-help@.apache

>>
>>





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-jqueryui-Kendo-DateTimePicker-timePattern-tp4661862p4661870.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: java.util.Properties as Form Model

2013-10-18 Thread Marios Skounakis
An idea is to wrap the Properties object in a class of your own
implementing Map as follows:

class MyProps implements Map {
  Properties props;

  public void put(String key, String value) {
if (value == null) props.remove(key);
else props.put(key, value);
}

This does sound like a bug in PropertyResolver as it should probably test
whether the Map is a Hashtable and call remove() since Hashtable is
documented to throw an NPE when put() is called with a null value.



On Fri, Oct 18, 2013 at 1:55 PM, Andy Van Den Heuvel <
andy.vandenheu...@gmail.com> wrote:

> Hey,
>
> I'm trying to create a form with a CompoundPropertyModel to fill a
> java.util.Properties object dynamically.
>
> Form form = new Form<>("form", new
> CompoundPropertyModel<>(properties));
> form.add(new TextField("host"));
> form.add(new TextField("port"));
>
> This works correct when I start from an empty java.util.Properties object.
> If I have an existing java.util.Properties object (with filled data)
> and I remove the value in the html page, I want the key-value pair to be
> deleted from the Properties object.
>
> With my current implementation I get a stacktrace (because it tries to
> write a null value in the java.util.Properties object)
>
> java.lang.NullPointerException
>  at java.util.Hashtable.put(Hashtable.java:432)
>  at
>
> org.apache.wicket.core.util.lang.PropertyResolver$MapGetSet.setValue(PropertyResolver.java:803)
>  at
>
> org.apache.wicket.core.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:644)
>  at
>
> org.apache.wicket.core.util.lang.PropertyResolver.setValue(PropertyResolver.java:144)
>
>
> Has anybody have an idea how best to create this behaviour?
> Thanks in advance for your help!
>


java.util.Properties as Form Model

2013-10-18 Thread Andy Van Den Heuvel
Hey,

I'm trying to create a form with a CompoundPropertyModel to fill a
java.util.Properties object dynamically.

Form form = new Form<>("form", new
CompoundPropertyModel<>(properties));
form.add(new TextField("host"));
form.add(new TextField("port"));

This works correct when I start from an empty java.util.Properties object.
If I have an existing java.util.Properties object (with filled data)
and I remove the value in the html page, I want the key-value pair to be
deleted from the Properties object.

With my current implementation I get a stacktrace (because it tries to
write a null value in the java.util.Properties object)

java.lang.NullPointerException
 at java.util.Hashtable.put(Hashtable.java:432)
 at
org.apache.wicket.core.util.lang.PropertyResolver$MapGetSet.setValue(PropertyResolver.java:803)
 at
org.apache.wicket.core.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:644)
 at
org.apache.wicket.core.util.lang.PropertyResolver.setValue(PropertyResolver.java:144)


Has anybody have an idea how best to create this behaviour?
Thanks in advance for your help!


Re: wicket- jqueryui Kendo DateTimePicker timePattern

2013-10-18 Thread Sebastien
Hi,

You can override DateTimePicker#newTimePicker

Best regards,
Sebastien.


On Fri, Oct 18, 2013 at 9:53 AM, Selom  wrote:

> Hi,
> Sorry I did not explain very well my problem.
> I am using the DateTimePicker (because i need the date ) class and there no
> constructor with such options   ?
>
> Thanks.
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wicket-jqueryui-Kendo-DateTimePicker-timePattern-tp4661862p4661867.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: wicket- jqueryui Kendo DateTimePicker timePattern

2013-10-18 Thread Selom
Hi,
Sorry I did not explain very well my problem.
I am using the DateTimePicker (because i need the date ) class and there no  
constructor with such options   ?

Thanks.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-jqueryui-Kendo-DateTimePicker-timePattern-tp4661862p4661867.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: Adding images dynamicly

2013-10-18 Thread Abigail
Hi there
You can just  add the new image
  
according to this method:
public REImage();
public REImage(int w, int h);
public REImage(int w, int h, ImageMode mode);
public REImage(int w, int h, ImageMode mode, byte[] data);
public REImage(int w, int h, ImageMode mode, byte[] data, RColor[]
colorPalette);




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-images-dynamicly-tp4447069p4661866.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: unwanted DefaultPageManagerProvider

2013-10-18 Thread Martin Grigorov
Hi,

Can you give more details about the setup and the problem ?


On Thu, Oct 17, 2013 at 11:35 PM, uwe schaefer  wrote:

> On 14.10.2013 21:41, uwe schaefer wrote:
>
>   could it also be a
>> racecondition with clustering and
>>
>> public void sessionUnbound(final String sessionId)
>>
>> being called before init() returns?
>>
>
> after further investigation it is pretty clear, that the above race
> condition happens (at least on tomcat6) - so if noone objects, i would hop
> to jira and create an issue for that.
>
> our quick workaround includes ignoring all WebApplicatoin.sessionUnbound(*
> *String) calls until initialization is complete.
>
>
> cu uwe
>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>