You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Илья Нарыжный <ph...@ydn.ru> on 2013/07/13 18:54:26 UTC

Recommendation service for form components

Hello,

Please advise me how following feature can be implemented in beloved Wicket:

We have a lot of forms and most of form components are used for configuring
of subsequent outputs: graphics, tables, etc. So this forms components are
used for output configuration. And it will be nice if such form components
can remember their last state among different pages and requests.

I have two variants:
1) Bind to every required form component model which related to user
WebSession.
2) Implement behavior which can "fix" formcomponent model: of there is no
value - behavior should set some default value. And also: after changing of
component value this behavior should store new value as default.

What r your recommendations? Might be there more elegant way...

Thanks,

Ilia

RE: Recommendation service for form components

Posted by Paul Bors <pa...@bors.ws>.
If you going to place too much in the user's session what's going to happen
when you'll have 100 users with 10 form fields?
You'll end up serializing about 1000 object at least! If not more...

Is a memory hug, but if you must okay... we'll run with it...

To grab the last value of a component you need to better defined what that
is. I have a generic AuditFormField that logs the before and after values
for each configuration change on each page.

Grabbing the original value is simple, you copy the model object value
onBeforeRender(), grabbing the changed value is not that simple as you need
to copy the model object value for each form submission.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Илья Нарыжный [mailto:phantom@ydn.ru] 
Sent: Sunday, July 14, 2013 1:31 AM
To: users@wicket.apache.org
Subject: Re: Recommendation service for form components

It's not a problem. I can serialize default values to any required place.
But I want to implement that in elegant way. Idea with Behavior seams to me
quite elegant, but I didn't find way to intercept "last value" of the form
component.


2013/7/14 Paul Bors <pa...@bors.ws>

> Sorry, by slow down I mean it would serialize all those model objects 
> under the session for no reason.
> It will eat up a lot of memory unnecessary.
>
> Try to add the DebugBar to the parent of all your pages so you can 
> track the session's memory consumption:
>
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/mar
> kup/ht 
> ml/panel/class-use/Panel.html#org.apache.wicket.devutils.debugbar
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Paul Bors [mailto:paul@bors.ws]
> Sent: Sunday, July 14, 2013 1:11 AM
> To: users@wicket.apache.org
> Subject: RE: Recommendation service for form components
>
> Why not persist to a db via Hibernate and Spring per say?
> Saving all this to the session would slow down your web server 
> considerably.
>
> You can also use cookies if you'd like, but that's not going to work 
> if the user has them turned off.
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Илья Нарыжный [mailto:phantom@ydn.ru]
> Sent: Saturday, July 13, 2013 12:54 PM
> To: users@wicket.apache.org
> Subject: Recommendation service for form components
>
> Hello,
>
> Please advise me how following feature can be implemented in beloved
> Wicket:
>
> We have a lot of forms and most of form components are used for 
> configuring of subsequent outputs: graphics, tables, etc. So this 
> forms components are used for output configuration. And it will be 
> nice if such form components can remember their last state among different
pages and requests.
>
> I have two variants:
> 1) Bind to every required form component model which related to user 
> WebSession.
> 2) Implement behavior which can "fix" formcomponent model: of there is 
> no value - behavior should set some default value. And also: after 
> changing of component value this behavior should store new value as
default.
>
> What r your recommendations? Might be there more elegant way...
>
> Thanks,
>
> Ilia
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


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


Re: Recommendation service for form components

Posted by Илья Нарыжный <ph...@ydn.ru>.
It's not a problem. I can serialize default values to any required place.
But I want to implement that in elegant way. Idea with Behavior seams to me
quite elegant, but I didn't find way to intercept "last value" of the form
component.


2013/7/14 Paul Bors <pa...@bors.ws>

> Sorry, by slow down I mean it would serialize all those model objects under
> the session for no reason.
> It will eat up a lot of memory unnecessary.
>
> Try to add the DebugBar to the parent of all your pages so you can track
> the
> session's memory consumption:
>
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/markup/ht
> ml/panel/class-use/Panel.html#org.apache.wicket.devutils.debugbar
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Paul Bors [mailto:paul@bors.ws]
> Sent: Sunday, July 14, 2013 1:11 AM
> To: users@wicket.apache.org
> Subject: RE: Recommendation service for form components
>
> Why not persist to a db via Hibernate and Spring per say?
> Saving all this to the session would slow down your web server
> considerably.
>
> You can also use cookies if you'd like, but that's not going to work if the
> user has them turned off.
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Илья Нарыжный [mailto:phantom@ydn.ru]
> Sent: Saturday, July 13, 2013 12:54 PM
> To: users@wicket.apache.org
> Subject: Recommendation service for form components
>
> Hello,
>
> Please advise me how following feature can be implemented in beloved
> Wicket:
>
> We have a lot of forms and most of form components are used for configuring
> of subsequent outputs: graphics, tables, etc. So this forms components are
> used for output configuration. And it will be nice if such form components
> can remember their last state among different pages and requests.
>
> I have two variants:
> 1) Bind to every required form component model which related to user
> WebSession.
> 2) Implement behavior which can "fix" formcomponent model: of there is no
> value - behavior should set some default value. And also: after changing of
> component value this behavior should store new value as default.
>
> What r your recommendations? Might be there more elegant way...
>
> Thanks,
>
> Ilia
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: Recommendation service for form components

Posted by Paul Bors <pa...@bors.ws>.
Sorry, by slow down I mean it would serialize all those model objects under
the session for no reason.
It will eat up a lot of memory unnecessary.

Try to add the DebugBar to the parent of all your pages so you can track the
session's memory consumption:
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/markup/ht
ml/panel/class-use/Panel.html#org.apache.wicket.devutils.debugbar

~ Thank you,
  Paul Bors

-----Original Message-----
From: Paul Bors [mailto:paul@bors.ws] 
Sent: Sunday, July 14, 2013 1:11 AM
To: users@wicket.apache.org
Subject: RE: Recommendation service for form components

Why not persist to a db via Hibernate and Spring per say?
Saving all this to the session would slow down your web server considerably.

You can also use cookies if you'd like, but that's not going to work if the
user has them turned off.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Илья Нарыжный [mailto:phantom@ydn.ru]
Sent: Saturday, July 13, 2013 12:54 PM
To: users@wicket.apache.org
Subject: Recommendation service for form components

Hello,

Please advise me how following feature can be implemented in beloved Wicket:

We have a lot of forms and most of form components are used for configuring
of subsequent outputs: graphics, tables, etc. So this forms components are
used for output configuration. And it will be nice if such form components
can remember their last state among different pages and requests.

I have two variants:
1) Bind to every required form component model which related to user
WebSession.
2) Implement behavior which can "fix" formcomponent model: of there is no
value - behavior should set some default value. And also: after changing of
component value this behavior should store new value as default.

What r your recommendations? Might be there more elegant way...

Thanks,

Ilia



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


RE: Recommendation service for form components

Posted by Paul Bors <pa...@bors.ws>.
Why not persist to a db via Hibernate and Spring per say?
Saving all this to the session would slow down your web server considerably.

You can also use cookies if you'd like, but that's not going to work if the
user has them turned off.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Илья Нарыжный [mailto:phantom@ydn.ru] 
Sent: Saturday, July 13, 2013 12:54 PM
To: users@wicket.apache.org
Subject: Recommendation service for form components

Hello,

Please advise me how following feature can be implemented in beloved Wicket:

We have a lot of forms and most of form components are used for configuring
of subsequent outputs: graphics, tables, etc. So this forms components are
used for output configuration. And it will be nice if such form components
can remember their last state among different pages and requests.

I have two variants:
1) Bind to every required form component model which related to user
WebSession.
2) Implement behavior which can "fix" formcomponent model: of there is no
value - behavior should set some default value. And also: after changing of
component value this behavior should store new value as default.

What r your recommendations? Might be there more elegant way...

Thanks,

Ilia


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