Re: Overriding Form.onFileUploadException in nested forms

2013-04-10 Thread Martin Grigorov
Hi,

Please create a ticket in Jira with a quickstart.


On Wed, Apr 10, 2013 at 7:11 PM, Martin Dietze  wrote:

> I am using Wicket 6.6.0, and I'm running into a nasty problem
> with upload sizes. In a complex editor, there is an upload
> component which itself contains a Form with an AjaxButton for
> triggering the upload.
>
> If the upload exceeds the allowed max size, the
> SizeLimitExceededException is caught in the outer form, i.e. the
> form to which the upload component was added. Thus, I cannot
> override Form.onFileUploadException in my inner form and thus
> not implement a custom handling (this is necessary, as in this
> case I need to explicitly call FeedbackPanel.error on my upload
> component's FeedbackPanel and add update it via Ajax). Adding
> custom code to the outer form is not an option as this way I'd
> have to modify all users of my upload component.
>
> Is this a bug or a feature?
>
> M'bert
>
> --
> --- / http://herbert.the-little-red-haired-girl.org /
> -
> =+=
> Wer bist du, ungezaehltes Frauenzimmer? Du bist - bist du? - Die Leute
> sagen,
> du waerest - lass sie sagen, sie wissen nicht, wie der Kirchturm steht.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: collapse/expand panel

2013-04-10 Thread Martin Grigorov
Hi,

For this you need to use JavaScript.
There are many JS plugins out there. Choose one for your prefered JS
library.


On Wed, Apr 10, 2013 at 7:26 PM, Teresa Batista Neto <
teresa.batista.n...@gmail.com> wrote:

> Dear all,
>
> Does anyone knows how can I add a collapse/expand panel to a form in
> wicket?
>
> Best regards,
> Teresa
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: Busy Indicator to prevent user activity

2013-04-10 Thread Ernesto Reinaldo Barreiro
I think what you are missing is just the CSS part of the solution Look,
for instance, at how modal window is creating blocking layer


On Thu, Apr 11, 2013 at 2:06 AM, saty  wrote:

> Following instructions works great however they do not address the problem
> of
> preventing user from clicking anywhere until the request is processed.
>
>
> https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
>
> I need the busy indicator / gif to layer the application so user may not be
> able to click anywhere,  any thoughts on how to achieve this would be
> highly
> appreciated.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Busy-Indicator-to-prevent-user-activity-tp4657877.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Busy Indicator to prevent user activity

2013-04-10 Thread saty
Following instructions works great however they do not address the problem of
preventing user from clicking anywhere until the request is processed.

https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

I need the busy indicator / gif to layer the application so user may not be
able to click anywhere,  any thoughts on how to achieve this would be highly
appreciated. 

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Busy-Indicator-to-prevent-user-activity-tp4657877.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



collapse/expand panel

2013-04-10 Thread Teresa Batista Neto
Dear all,

Does anyone knows how can I add a collapse/expand panel to a form in
wicket?

Best regards,
Teresa


Re: Question / extracting models in constructors

2013-04-10 Thread Sven Meier
You never know whether the given model is ready for its #getObject() to 
be called. For example ResourceModel needs its owning component to be 
attached to a page to function properly.


>"we have to extract it anyway, just somewhere else."

I'd phrase it "we have to extract it anyway, just somewhat later".

But you don't have to be overzealous about this. If it works for you, 
it's fine.


Best regards
Sven



On 04/10/2013 05:54 PM, Patrick Davids wrote:

Thank you. :-)
Interesting concept...

Unfortunately still have the question:
Why is it recommended not to extract a given model (1), if it is just
needed to create another empty model (2) via a servicecall in a
constructor (I do not hold a reference to model (1) as member in the
page or component)?

And why should I explicitly not do an extract in a constructor?

I'm asking because our discussion always ends into "we have to extract
it anyway, just somewhere else."

regards
Patrick


Am 10.04.2013 17:04, schrieb Sven Meier:

public abstract class CreateAndSetIfNull extends
AbstractReadOnlyModel {

private T model;

public CreateAndSetIfNull(IModel model) {
  this.model = model;
}

public T getObject() {
  T t = model.getObject();
  if (t == null) {
t = onCreate();
model.setObject(t);
  }
  return t;
}

public void detach() {
  model.detach();
}

protected abstract T onCreate();
}


On 04/10/2013 04:47 PM, Patrick Davids wrote:

Hi Sven,
and who calls onCreate() and when is it called?

regards
Patrick

Am 10.04.2013 16:20, schrieb Sven Meier:

extracting model [objects] in constructors of components.
Best practices says: DONT

How about creating the address lazily?

 IModel address = new CreateAndSetIfNull(new
PropertyModel(person, "address")) {
   protected Address onCreate() {
  return addressService.newAddress();
   }
 };

Regards
Sven



On 04/10/2013 03:56 PM, Patrick Davids wrote:

Hi together,

I'm in a discussion with my collegues about extracting models in
constructors of components.

Best practices says: DONT, because of accidently holding references of
extrated objects / out of mems / etc.

But, if we want to have a component containing a form is responsable to
create its own emtpy model, if not created yet.

Is it ok, to extract a model "temporary"?

here an axample:

A person has an address.
An extra component panel with form fields for creating/editing
addresses
exists (nested forms pattern).
The AdressComponent gets a model of person.

In case of: person does not have an address, yet.

Is it allowed to extract the person model, to make a service call
somewhere to let create an empty address object for this particular
person and then setting the model object on my own?

We would like to have the knowledge about creation and saving addresses
put toghether in the AddressComponent instead of having the knowledge
about saving inside (onSubmit() of form), and the knowledge about
creation outside the AddressComponent.

kind regards
Patrick
-
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




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



Overriding Form.onFileUploadException in nested forms

2013-04-10 Thread Martin Dietze
I am using Wicket 6.6.0, and I'm running into a nasty problem
with upload sizes. In a complex editor, there is an upload
component which itself contains a Form with an AjaxButton for
triggering the upload. 

If the upload exceeds the allowed max size, the 
SizeLimitExceededException is caught in the outer form, i.e. the
form to which the upload component was added. Thus, I cannot
override Form.onFileUploadException in my inner form and thus
not implement a custom handling (this is necessary, as in this
case I need to explicitly call FeedbackPanel.error on my upload
component's FeedbackPanel and add update it via Ajax). Adding
custom code to the outer form is not an option as this way I'd
have to modify all users of my upload component.

Is this a bug or a feature? 

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Wer bist du, ungezaehltes Frauenzimmer? Du bist - bist du? - Die Leute sagen, 
du waerest - lass sie sagen, sie wissen nicht, wie der Kirchturm steht. 

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



Re: Question / extracting models in constructors

2013-04-10 Thread Patrick Davids
Thank you. :-)
Interesting concept...

Unfortunately still have the question:
Why is it recommended not to extract a given model (1), if it is just 
needed to create another empty model (2) via a servicecall in a 
constructor (I do not hold a reference to model (1) as member in the 
page or component)?

And why should I explicitly not do an extract in a constructor?

I'm asking because our discussion always ends into "we have to extract 
it anyway, just somewhere else."

regards
Patrick


Am 10.04.2013 17:04, schrieb Sven Meier:
> public abstract class CreateAndSetIfNull extends
> AbstractReadOnlyModel {
>
>private T model;
>
>public CreateAndSetIfNull(IModel model) {
>  this.model = model;
>}
>
>public T getObject() {
>  T t = model.getObject();
>  if (t == null) {
>t = onCreate();
>model.setObject(t);
>  }
>  return t;
>}
>
>public void detach() {
>  model.detach();
>}
>
>protected abstract T onCreate();
> }
>
>
> On 04/10/2013 04:47 PM, Patrick Davids wrote:
>> Hi Sven,
>> and who calls onCreate() and when is it called?
>>
>> regards
>> Patrick
>>
>> Am 10.04.2013 16:20, schrieb Sven Meier:
 extracting model [objects] in constructors of components.
 Best practices says: DONT
>>> How about creating the address lazily?
>>>
>>> IModel address = new CreateAndSetIfNull(new
>>> PropertyModel(person, "address")) {
>>>   protected Address onCreate() {
>>>  return addressService.newAddress();
>>>   }
>>> };
>>>
>>> Regards
>>> Sven
>>>
>>>
>>>
>>> On 04/10/2013 03:56 PM, Patrick Davids wrote:
 Hi together,

 I'm in a discussion with my collegues about extracting models in
 constructors of components.

 Best practices says: DONT, because of accidently holding references of
 extrated objects / out of mems / etc.

 But, if we want to have a component containing a form is responsable to
 create its own emtpy model, if not created yet.

 Is it ok, to extract a model "temporary"?

 here an axample:

 A person has an address.
 An extra component panel with form fields for creating/editing
 addresses
 exists (nested forms pattern).
 The AdressComponent gets a model of person.

 In case of: person does not have an address, yet.

 Is it allowed to extract the person model, to make a service call
 somewhere to let create an empty address object for this particular
 person and then setting the model object on my own?

 We would like to have the knowledge about creation and saving addresses
 put toghether in the AddressComponent instead of having the knowledge
 about saving inside (onSubmit() of form), and the knowledge about
 creation outside the AddressComponent.

 kind regards
 Patrick
 -
 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
>>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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



Re: Question / extracting models in constructors

2013-04-10 Thread Sven Meier

extracting model [objects] in constructors of components.
Best practices says: DONT


How about creating the address lazily?

  IModel address = new CreateAndSetIfNull(new 
PropertyModel(person, "address")) {

protected Address onCreate() {
   return addressService.newAddress();
}
  };

Regards
Sven



On 04/10/2013 03:56 PM, Patrick Davids wrote:

Hi together,

I'm in a discussion with my collegues about extracting models in
constructors of components.

Best practices says: DONT, because of accidently holding references of
extrated objects / out of mems / etc.

But, if we want to have a component containing a form is responsable to
create its own emtpy model, if not created yet.

Is it ok, to extract a model "temporary"?

here an axample:

A person has an address.
An extra component panel with form fields for creating/editing addresses
exists (nested forms pattern).
The AdressComponent gets a model of person.

In case of: person does not have an address, yet.

Is it allowed to extract the person model, to make a service call
somewhere to let create an empty address object for this particular
person and then setting the model object on my own?

We would like to have the knowledge about creation and saving addresses
put toghether in the AddressComponent instead of having the knowledge
about saving inside (onSubmit() of form), and the knowledge about
creation outside the AddressComponent.

kind regards
Patrick
-
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



Question / extracting models in constructors

2013-04-10 Thread Patrick Davids
Hi together,

I'm in a discussion with my collegues about extracting models in 
constructors of components.

Best practices says: DONT, because of accidently holding references of 
extrated objects / out of mems / etc.

But, if we want to have a component containing a form is responsable to 
create its own emtpy model, if not created yet.

Is it ok, to extract a model "temporary"?

here an axample:

A person has an address.
An extra component panel with form fields for creating/editing addresses 
exists (nested forms pattern).
The AdressComponent gets a model of person.

In case of: person does not have an address, yet.

Is it allowed to extract the person model, to make a service call 
somewhere to let create an empty address object for this particular 
person and then setting the model object on my own?

We would like to have the knowledge about creation and saving addresses 
put toghether in the AddressComponent instead of having the knowledge 
about saving inside (onSubmit() of form), and the knowledge about 
creation outside the AddressComponent.

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



Re: Loading the contents of an expensive panel asynchronously

2013-04-10 Thread pureza
Thanks, that did it!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loading-the-contents-of-an-expensive-panel-asynchronously-tp4657864p4657870.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: IHeaderResponse serialization problem Wicket 6

2013-04-10 Thread datazuul
Hi Martin,

the thirdparty libraries hint seems to be a good one.
I use visural wicket for 1.5... (and some others like wiquery...)
I will remove this dependency/ies and come back with the result later (when
I am at home and can verify this)

thanks, so far!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IHeaderResponse-serialization-problem-Wicket-6-tp4657862p4657869.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: REDIRECT_TO_BUFFER and Url encoding problem with Umlauts

2013-04-10 Thread Martin Grigorov
Thanks for sharing, Dirk!


On Wed, Apr 10, 2013 at 12:05 PM, Dirk Forchel wrote:

> Heureka, I found the solution by myself. I changed the URI encoding in my
> server.xml and all works fine:
>
> 
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/REDIRECT-TO-BUFFER-and-Url-encoding-problem-with-Umlauts-tp4657840p4657865.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
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: Loading the contents of an expensive panel asynchronously

2013-04-10 Thread Martin Grigorov
Hi,

Just use an AjaxLink that shows the "Loading..." div element in beforeSend
handler (IAjaxCallListener) and replace it with the real panel within the
Ajax response.
It is normal Wicket Ajax replacement.


On Wed, Apr 10, 2013 at 11:52 AM, pureza  wrote:

> Hi,
>
> I am using a bootstrap dropdown
> (http://twitter.github.io/bootstrap/javascript.html#dropdowns) and I want
> its submenu to load only when the user clicks the dropdown, because its
> contents are expensive to retrieve.
>
> To be more concrete, this is the behavior that I'm looking for: when the
> user first clicks the dropdown, I want to just show "Loading..." in the
> submenu. At the same time, I want to initiate the retrieval of the real
> submenu's options asynchronously. When these options have been retrieved
> (possibly many seconds later), I want to replace "Loading..." with them.
>
> I am a bit lost as to how to do this. I'm unsure as to whether I should use
> an AjaxLazyLoadPanel or an AbstractAjaxTimerBehavior or something else. Any
> recommendations or any example code that I could learn from?
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Loading-the-contents-of-an-expensive-panel-asynchronously-tp4657864.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
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: REDIRECT_TO_BUFFER and Url encoding problem with Umlauts

2013-04-10 Thread Dirk Forchel
Heureka, I found the solution by myself. I changed the URI encoding in my
server.xml and all works fine:





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/REDIRECT-TO-BUFFER-and-Url-encoding-problem-with-Umlauts-tp4657840p4657865.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: IHeaderResponse serialization problem Wicket 6

2013-04-10 Thread Martin Grigorov
Hi,

Maybe you use a third party library that is compiled against Wicket 1.5.x.
Additionally it seems there is a hard reference to an instance of
IHeaderResponse and it is being serialized with the page. The problem is
during serialization, not deserialization.
When you find it make sure that you remove this hard ref - there is no need
of it.


On Tue, Apr 9, 2013 at 11:38 PM, datazuul  wrote:

> After migrating my webapp from 1.5.7 to 6.6.0
> (thus changing all
> org.apache.wicket.markup.html.IHeaderResponse
> to
> org.apache.wicket.markup.head.IHeaderResponse)
>
> I fire up my webapp with embedded Jetty and get an
>
> java.lang.NoClassDefFoundError:
> org/apache/wicket/markup/html/IHeaderResponse
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
> at java.lang.Class.getDeclaredMethod(Class.java:1952)
> at
> java.io.ObjectStreamClass.getPrivateMethod(ObjectStreamClass.java:1411)
> at java.io.ObjectStreamClass.access$1700(ObjectStreamClass.java:69)
> at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:481)
> at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:455)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.io.ObjectStreamClass.(ObjectStreamClass.java:455)
> at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:352)
> at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1130)
> at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
> at java.util.ArrayList.writeObject(ArrayList.java:710)
> at sun.reflect.GeneratedMethodAccessor386.invoke(Unknown Source)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
> at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
>
> How comes?
> I already made a clean install, deleted all cookies, ...
> Seems that some old serialization artifacts around?
>
> In Java code there is no import of the old package name anymore...
> I also updated the static serial version uid of my basepage...
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/IHeaderResponse-serialization-problem-Wicket-6-tp4657862.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
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Loading the contents of an expensive panel asynchronously

2013-04-10 Thread pureza
Hi,

I am using a bootstrap dropdown
(http://twitter.github.io/bootstrap/javascript.html#dropdowns) and I want
its submenu to load only when the user clicks the dropdown, because its
contents are expensive to retrieve.

To be more concrete, this is the behavior that I'm looking for: when the
user first clicks the dropdown, I want to just show "Loading..." in the
submenu. At the same time, I want to initiate the retrieval of the real
submenu's options asynchronously. When these options have been retrieved
(possibly many seconds later), I want to replace "Loading..." with them.

I am a bit lost as to how to do this. I'm unsure as to whether I should use
an AjaxLazyLoadPanel or an AbstractAjaxTimerBehavior or something else. Any
recommendations or any example code that I could learn from?

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loading-the-contents-of-an-expensive-panel-asynchronously-tp4657864.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: REDIRECT_TO_BUFFER and Url encoding problem with Umlauts

2013-04-10 Thread Dirk Forchel
Seems to be not a problem with Wicket but rather with Tomcat. The requestURI
is not encoded correctly (see below).

target Url: landing/M%C3%A4nner/men.html
redirect_to_buffer targetUrl: landing/M%C3%A4nner/men.html
targetUrl2: landing/M%C3%A4nner/men.html?1
storeBufferedResponse: landing/M%C3%A4nner/men.html?1
redirectTo: landing/M%C3%A4nner/men.html?1
response.sendRedirect: ./men.html?1
encodeRedirectURL: ./men.html?1
encodedRelativeUrl: ./men.html?1
httpServletResponse org.apache.catalina.connector.ResponseFacade
sendRedirect men.html?1
ServletWebRequest for HttpServletRequest
org.apache.catalina.connector.RequestFacade@9d54b17 url=null requestURI
/germanyb2c/de/landing/M%c3%83%c2%a4nner/men.html

Did someone experience similar problems? We're using Tomcat 7.0.29.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/REDIRECT-TO-BUFFER-and-Url-encoding-problem-with-Umlauts-tp4657840p4657863.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