How to have custom components interact with CompoundPropertyModel?

2011-05-28 Thread huberc

Hi all,

I am pretty new to Wicket (using 1.4.10) and have some hard time to figure out 
how the interaction between components and models exactly works. So I was 
hopeing that someone here could enlighten me or tell me where I should look 
(WARNING: Rather lengthy post).


My particular problem is that I have a custom component that extends 
FormComponentCalendar to display a date in a certain way. This component is 
part of a Panel in which I use a CompoundPropertyModel to render an object 
containing a calendar among other things (the object is fully populated and 
load from the database by using a LoadableDetachableModel chained to the 
CompoundPropertyModel).


For the other object fields I simply use TextFields which get populated 
properly and when I use a TextFieldcalendar instead of my custom component 
the field contains the result of Calendar.toString so I guess the Panel it's 
children and the corresponding are set up correctly.


But whenever I use my custom component I don't get a reference to that Calendar 
instance. I did try to get some insights by looking into the code of the 
TextField class and overriding various methods from super classes but I just 
did not get it.


To my understanding something like setModel or setModelObject on my component 
should be called so I can override this method and do my custom stuff in it. 
But somehow this does not happen. During debugging I saw that the Panel is set 
as my components parent and everything seeme to be stuck together correctly. 
But somehow I can't get the Calendar instance from my object to get set as my 
components model value.


So I figure that I am missing some vital point on this topic and would be very 
grateful for any advice, like an how to for extending Components or something 
similar.


Thanks for reading this far,
Chris

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



Re: Original page cloned after popup dialog closes

2011-05-28 Thread andrea del bene

Hi,

sorry but I don't understand where is the model you are trying to 
modify. Are you sharing a model instance between modal window and 
RadioListFilterDialog? What does refreshRadioListAreaResponse method do?

Andre,
  Line 41 opens the dialog. The object ID of the page is the same 
there, on line 6 where the dialog is constructed as well as in the 
dialog once it opens. When the dialog closes and we get to line 11, 
the ID has changed and the component model does not have the changes 
that were made in the dialog. The request target at line 11 has the 
new page object ID as well.

  Thanks for looking at this,
Scott



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



Re: How to have custom components interact with CompoundPropertyModel?

2011-05-28 Thread andrea del bene

Hi,
Have you called setType(Calendar.class) in your custom form component? 
Does its model remain 'null'?

Hi all,

I am pretty new to Wicket (using 1.4.10) and have some hard time to 
figure out how the interaction between components and models exactly 
works. So I was hopeing that someone here could enlighten me or tell 
me where I should look (WARNING: Rather lengthy post).


My particular problem is that I have a custom component that extends 
FormComponentCalendar to display a date in a certain way. This 
component is part of a Panel in which I use a CompoundPropertyModel to 
render an object containing a calendar among other things (the object 
is fully populated and load from the database by using a 
LoadableDetachableModel chained to the CompoundPropertyModel).


For the other object fields I simply use TextFields which get 
populated properly and when I use a TextFieldcalendar instead of my 
custom component the field contains the result of Calendar.toString so 
I guess the Panel it's children and the corresponding are set up 
correctly.


But whenever I use my custom component I don't get a reference to that 
Calendar instance. I did try to get some insights by looking into the 
code of the TextField class and overriding various methods from super 
classes but I just did not get it.


To my understanding something like setModel or setModelObject on my 
component should be called so I can override this method and do my 
custom stuff in it. But somehow this does not happen. During debugging 
I saw that the Panel is set as my components parent and everything 
seeme to be stuck together correctly. But somehow I can't get the 
Calendar instance from my object to get set as my components model value.


So I figure that I am missing some vital point on this topic and would 
be very grateful for any advice, like an how to for extending 
Components or something similar.


Thanks for reading this far,
Chris

-
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: How to have custom components interact with CompoundPropertyModel?

2011-05-28 Thread James Carman
Please list your constructors of your custom component.  I believe the
auto-resolving of models from a parent CPM is done during the
constructor (the one with just the component id).

On Sat, May 28, 2011 at 8:27 AM, andrea del bene
andrea.on@libero.it wrote:
 Hi,
 Have you called setType(Calendar.class) in your custom form component? Does
 its model remain 'null'?

 Hi all,

 I am pretty new to Wicket (using 1.4.10) and have some hard time to figure
 out how the interaction between components and models exactly works. So I
 was hopeing that someone here could enlighten me or tell me where I should
 look (WARNING: Rather lengthy post).

 My particular problem is that I have a custom component that extends
 FormComponentCalendar to display a date in a certain way. This component
 is part of a Panel in which I use a CompoundPropertyModel to render an
 object containing a calendar among other things (the object is fully
 populated and load from the database by using a LoadableDetachableModel
 chained to the CompoundPropertyModel).

 For the other object fields I simply use TextFields which get populated
 properly and when I use a TextFieldcalendar instead of my custom component
 the field contains the result of Calendar.toString so I guess the Panel it's
 children and the corresponding are set up correctly.

 But whenever I use my custom component I don't get a reference to that
 Calendar instance. I did try to get some insights by looking into the code
 of the TextField class and overriding various methods from super classes but
 I just did not get it.

 To my understanding something like setModel or setModelObject on my
 component should be called so I can override this method and do my custom
 stuff in it. But somehow this does not happen. During debugging I saw that
 the Panel is set as my components parent and everything seeme to be stuck
 together correctly. But somehow I can't get the Calendar instance from my
 object to get set as my components model value.

 So I figure that I am missing some vital point on this topic and would be
 very grateful for any advice, like an how to for extending Components or
 something similar.

 Thanks for reading this far,
 Chris

 -
 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



Re: Original page cloned after popup dialog closes

2011-05-28 Thread Scott Reed

Hi,
  Let's work with the example I sent you last night since it's complete 
and there's nothing to explain.

  Thanks,
Scott

On 5/28/2011 3:49 AM, andrea del bene wrote:

Hi,

sorry but I don't understand where is the model you are trying to 
modify. Are you sharing a model instance between modal window and 
RadioListFilterDialog? What does refreshRadioListAreaResponse method do?

Andre,
  Line 41 opens the dialog. The object ID of the page is the same 
there, on line 6 where the dialog is constructed as well as in the 
dialog once it opens. When the dialog closes and we get to line 11, 
the ID has changed and the component model does not have the changes 
that were made in the dialog. The request target at line 11 has the 
new page object ID as well.

  Thanks for looking at this,
Scott



-
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



Wicket / Hibernate / Databinder (dead?)

2011-05-28 Thread jbrookover
Hey all,

First off, apologies for a potential dual post - I used nabble and posted to
a super-level to this list.

We've been using Wicket 1.4 + Hibernate 3.3 + Databinder 1.3.0 for quite
some time now.  I wanted to update to a more recent version of Hibernate,
but Databinder was incompatible and seems pretty dead.

My question is what do people use for their bridge between Wicket and
Hibernate?  Do you all write your own LoadableDetachableModels to load from
the database?  Is there an alternative to Databinder that I don't know
about?  A wicketstuff wiki page mentioned 'HibernateModel' but I haven't
seen any actual code.

I love Databinder's HibernateObjectModel, SortableHibernateProvider, etc. 
If there's nothing else, I'll keep on updating them, but I wanted to make
sure there wasn't some more active alternative.

Thanks!

Jake 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557635.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: Original page cloned after popup dialog closes

2011-05-28 Thread Scott Reed
Wicket creates a new version of the page after a popup Modal Window 
closes. This means any changes made to the original page from the popup 
are lost once the popup is closed. I suppose I could store the data for 
the change in the session and change the new page version after the 
popup closes but that is inelegant. Is there a way to prevent the extra 
version from being created (and why is it being created anyway?)  or is 
there some more elegant approach I could try?

  Thanks,
Scott

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



Re: Wicket / Hibernate / Databinder (dead?)

2011-05-28 Thread James Carman
You could check out Wicketopia.  It has support for Hibernate.  You
can run the example application to see how it works.

On Sat, May 28, 2011 at 11:48 AM, jbrookover jbrooko...@cast.org wrote:
 Hey all,

 First off, apologies for a potential dual post - I used nabble and posted to
 a super-level to this list.

 We've been using Wicket 1.4 + Hibernate 3.3 + Databinder 1.3.0 for quite
 some time now.  I wanted to update to a more recent version of Hibernate,
 but Databinder was incompatible and seems pretty dead.

 My question is what do people use for their bridge between Wicket and
 Hibernate?  Do you all write your own LoadableDetachableModels to load from
 the database?  Is there an alternative to Databinder that I don't know
 about?  A wicketstuff wiki page mentioned 'HibernateModel' but I haven't
 seen any actual code.

 I love Databinder's HibernateObjectModel, SortableHibernateProvider, etc.
 If there's nothing else, I'll keep on updating them, but I wanted to make
 sure there wasn't some more active alternative.

 Thanks!

 Jake

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557635.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



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



Re: Original page cloned after popup dialog closes

2011-05-28 Thread andrea del bene
Store data and sharing them across pages/components should be Wicket 
model's purpose. In your code you create a RadioListFilterDialog as 
modal window content. Do you pass it the original model of RadioListPage?
Wicket creates a new version of the page after a popup Modal Window 
closes. This means any changes made to the original page from the 
popup are lost once the popup is closed. I suppose I could store the 
data for the change in the session and change the new page version 
after the popup closes but that is inelegant. Is there a way to 
prevent the extra version from being created (and why is it being 
created anyway?)  or is there some more elegant approach I could try?

  Thanks,
Scott

-
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: Wicket / Hibernate / Databinder (dead?)

2011-05-28 Thread Daniel Toffetti

jbrookover wrote:
 
 We've been using Wicket 1.4 + Hibernate 3.3 + Databinder 1.3.0 for quite
 some time now.  I wanted to update to a more recent version of Hibernate,
 but Databinder was incompatible and seems pretty dead.
 
 My question is what do people use for their bridge between Wicket and
 Hibernate?  Do you all write your own LoadableDetachableModels to load
 from the database?  Is there an alternative to Databinder that I don't
 know about?  A wicketstuff wiki page mentioned 'HibernateModel' but I
 haven't seen any actual code.
 
 I love Databinder's HibernateObjectModel, SortableHibernateProvider, etc. 
 If there's nothing else, I'll keep on updating them, but I wanted to make
 sure there wasn't some more active alternative.
 

Hi,

AFAIK Nathan was not maintaining it anymore but Rodolfo Hansen was
working on it a while ago to get it up to new versions of Hibernate and
Wicket, please check here: https://github.com/kryptt, last updates are from
April 5.

Cheers,

Daniel


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557902.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 / Hibernate / Databinder (dead?)

2011-05-28 Thread jbrookover

James Carman wrote:
 
 You could check out Wicketopia.  It has support for Hibernate.  You
 can run the example application to see how it works.
 

I've been doing some searching and found many of your replies to this
statement, but I was thinking without Spring involvement.  I don't have any
solid reasons for not using Spring other than I have no idea what it does
and haven't needed it :)  Seems very heavy whereas Databinder was extremely
light.  Granted, perhaps Spring is in my future.


Daniel Toffetti wrote:
 
 AFAIK Nathan was not maintaining it anymore but Rodolfo Hansen was working
 on it a while ago to get it up to new versions of Hibernate and Wicket,
 please check here: https://github.com/kryptt, last updates are from April
 5.
 

Those updates were just to the project structure, I believe.  I checked out
the project and made my own changes to the snapshot to get it working. 
There are many more changes and, being a newb to Git, I'm still working on
getting those back into the mainstream.  This is what prompted this thread -
I don't want to make these fixes if people are using some other light
library.

Still seems like a common issue.  People out there must be using Wicket +
Hibernate without Spring, right?

Jake

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557917.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: Original page cloned after popup dialog closes

2011-05-28 Thread Scott Reed
Yes. I pass the original page and the model is accessed by a getter. 
When the modal window closes and the onClose() callback is called, the 
page and the model have been replaced by clones.


On 5/28/2011 2:03 PM, andrea del bene wrote:
Store data and sharing them across pages/components should be Wicket 
model's purpose. In your code you create a RadioListFilterDialog as 
modal window content. Do you pass it the original model of RadioListPage?
Wicket creates a new version of the page after a popup Modal Window 
closes. This means any changes made to the original page from the 
popup are lost once the popup is closed. I suppose I could store the 
data for the change in the session and change the new page version 
after the popup closes but that is inelegant. Is there a way to 
prevent the extra version from being created (and why is it being 
created anyway?)  or is there some more elegant approach I could try?

  Thanks,
Scott

-
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



Re: Wicket / Hibernate / Databinder (dead?)

2011-05-28 Thread James Carman
Wicketopia doesn't require spring.
On May 28, 2011 3:13 PM, jbrookover jbrooko...@cast.org wrote:

 James Carman wrote:

 You could check out Wicketopia. It has support for Hibernate. You
 can run the example application to see how it works.


 I've been doing some searching and found many of your replies to this
 statement, but I was thinking without Spring involvement. I don't have any
 solid reasons for not using Spring other than I have no idea what it does
 and haven't needed it :) Seems very heavy whereas Databinder was extremely
 light. Granted, perhaps Spring is in my future.


 Daniel Toffetti wrote:

 AFAIK Nathan was not maintaining it anymore but Rodolfo Hansen was
working
 on it a while ago to get it up to new versions of Hibernate and Wicket,
 please check here: https://github.com/kryptt, last updates are from April
 5.


 Those updates were just to the project structure, I believe. I checked out
 the project and made my own changes to the snapshot to get it working.
 There are many more changes and, being a newb to Git, I'm still working on
 getting those back into the mainstream. This is what prompted this thread
-
 I don't want to make these fixes if people are using some other light
 library.

 Still seems like a common issue. People out there must be using Wicket +
 Hibernate without Spring, right?

 Jake

 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557917.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 / Hibernate / Databinder (dead?)

2011-05-28 Thread Rodolfo Hansen
I also have a bit of code we have been working on..

I was sorta procrastinating with it on my local box.

Things have been rather overwhelming lately.

If you would like to make a pull request, I will gladly review it, and merge
it into my branch.

I actually have some work regarding integration for the conversation scope
with spring.

On Sat, May 28, 2011 at 3:43 PM, James Carman
jcar...@carmanconsulting.comwrote:

 Wicketopia doesn't require spring.
 On May 28, 2011 3:13 PM, jbrookover jbrooko...@cast.org wrote:
 
  James Carman wrote:
 
  You could check out Wicketopia. It has support for Hibernate. You
  can run the example application to see how it works.
 
 
  I've been doing some searching and found many of your replies to this
  statement, but I was thinking without Spring involvement. I don't have
 any
  solid reasons for not using Spring other than I have no idea what it does
  and haven't needed it :) Seems very heavy whereas Databinder was
 extremely
  light. Granted, perhaps Spring is in my future.
 
 
  Daniel Toffetti wrote:
 
  AFAIK Nathan was not maintaining it anymore but Rodolfo Hansen was
 working
  on it a while ago to get it up to new versions of Hibernate and Wicket,
  please check here: https://github.com/kryptt, last updates are from
 April
  5.
 
 
  Those updates were just to the project structure, I believe. I checked
 out
  the project and made my own changes to the snapshot to get it working.
  There are many more changes and, being a newb to Git, I'm still working
 on
  getting those back into the mainstream. This is what prompted this thread
 -
  I don't want to make these fixes if people are using some other light
  library.
 
  Still seems like a common issue. People out there must be using Wicket +
  Hibernate without Spring, right?
 
  Jake
 
  --
  View this message in context:

 http://apache-wicket.1842946.n4.nabble.com/Wicket-Hibernate-Databinder-dead-tp3557635p3557917.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
 




-- 
Rodolfo Hansen
CTO, KindleIT Software Development
Email: rhan...@kitsd.com
Mobile: +1 (809) 860-6669