You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by PDiefent <pd...@csc.com> on 2009/03/19 09:01:27 UTC

Update DropDownChoice with ModalWindow

Hi,
In my panel I have a DropDownChoice with names. An AjaxLink opens a
ModalWindow where I can enter a new name. After submitting the modal window,
the new name is stored in the database and the new entry is added to the
DropDownChoice contents. All this works fine, but one problem remains: The
new name doesn't show up in the DropDownChoice field, only "Choose value" is
shown.
Any suggestions?
Thanx, Peter
-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p22595072.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Update DropDownChoice with ModalWindow

Posted by Geeta Madhavi <ma...@gmail.com>.
Hi,

Please go through this link you will find the source code.This is pretty
help ful for drop down.

http://www.wicket-library.com/wicket-examples/ajax/choice.0


On Wed, Apr 29, 2009 at 11:18 AM, PDiefent <pd...@csc.com> wrote:

>
> Hi Vladimir,
> for the solution, look at
> http://www.nabble.com/Update-DropDownChoice-td22944165.html
> Peter
>
> Vladimir K wrote:
> >
> > PDiefent,
> >
> > I've came across similar problem. In my case, and what I'm discovered
> fits
> > your case as well, the following is happening:
> >
> > ModalWindow is component based. It is rendered in two parts. The first
> > part is all you put into your markup. The second part is dynamically
> built
> > within a separate div within the <body> tag.
> >
> > Concerning browser's DOM, your form and modal window form are not
> > overlapped. Nothing is passed for DDChoice when modal window form is
> > submitted.
> > Concerning wicket tree your form and modal window form are overlapped
> > (modal form is within). So when wicket is updating formcomponent models
> > (and it starts from the outermost form for some reason), it has to fill
> > DDC, but nothing is passed in request for it. So wicket fills it with
> > null, what explains "choose a value" message in it.
> >
> > I don't know what is actually wrong - how wicket is processing form or
> > ModalWindow implementation that renders modal window somewhere outside of
> > the place you pointed. It is up to authors to decide.
> >
> > I'm going to investigate workarounds. Will be back if suceed.
> >
>
> --
> View this message in context:
> http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p23290916.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards.
Geeta Madhavi. K

Re: Update DropDownChoice with ModalWindow

Posted by PDiefent <pd...@csc.com>.
Hi Vladimir,
for the solution, look at
http://www.nabble.com/Update-DropDownChoice-td22944165.html
Peter

Vladimir K wrote:
> 
> PDiefent,
> 
> I've came across similar problem. In my case, and what I'm discovered fits
> your case as well, the following is happening:
> 
> ModalWindow is component based. It is rendered in two parts. The first
> part is all you put into your markup. The second part is dynamically built
> within a separate div within the <body> tag.
> 
> Concerning browser's DOM, your form and modal window form are not
> overlapped. Nothing is passed for DDChoice when modal window form is
> submitted.
> Concerning wicket tree your form and modal window form are overlapped
> (modal form is within). So when wicket is updating formcomponent models
> (and it starts from the outermost form for some reason), it has to fill
> DDC, but nothing is passed in request for it. So wicket fills it with
> null, what explains "choose a value" message in it.
> 
> I don't know what is actually wrong - how wicket is processing form or
> ModalWindow implementation that renders modal window somewhere outside of
> the place you pointed. It is up to authors to decide.
> 
> I'm going to investigate workarounds. Will be back if suceed.
> 

-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p23290916.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Update DropDownChoice with ModalWindow

Posted by Vladimir K <ko...@gmail.com>.
The problem is duscussed here 
http://www.nabble.com/Form-values-lost-in-combination-of-Forms-plus-ModalWindow-td19401595.html#a19401595
http://www.nabble.com/Form-values-lost-in-combination-of-Forms-plus-ModalWindow-td19401595.html#a19401595 


Vladimir K wrote:
> 
> PDiefent,
> 
> I've came across similar problem. In my case, and what I'm discovered fits
> your case as well, the following is happening:
> ...
> 

-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p23274193.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Re: Update DropDownChoice with ModalWindow

Posted by Vladimir K <ko...@gmail.com>.
PDiefent,

I've came across similar problem. In my case, and what I'm discovered fits
your case as well, the following is happening:

ModalWindow is component based. It is rendered in two parts. The first part
is all you put into your markup. The second part is dynamically built within
a separate div within the <body> tag.

Concerning browser's DOM, your form and modal window form are not
overlapped. Nothing is passed for DDChoice when modal window form is
submitted.
Concerning wicket tree your form and modal window form are overlapped (modal
form is within). So when wicket is updating formcomponent models (and it
starts from the outermost form for some reason), it has to fill DDC, but
nothing is passed in request for it. So wicket fills it with null, what
explains "choose a value" message in it.

I don't know what is actually wrong - how wicket is processing form or
ModalWindow implementation that renders modal window somewhere outside of
the place you pointed. It is up to authors to decide.

I'm going to investigate workarounds. Will be back if suceed.


PDiefent wrote:
> 
> It's definitely not a hashCode/equals problem, because when the page is
> rendered, the initial value of the dropDown is set correctly from the
> PropertyModel. After coming back from the modal window the DropDownChoice
> can't set the new value ...
> 
> asfernandes wrote:
>> 
>>> Looks like lack of hashCode/equals implementation for the type used.
>>> I suffered from exactly problem as you initially described... But in my 
>>> case, however, equals() was implemented to always return false, and 
>>> DropDownChoice calls it. Perhaps, your problem is different, but I don't 
>>> know if it can happen due to different instances of objects created by 
>>> LoadableDetachableModel so you had to correctly override this method, or 
>>> is a totally different thing...
>>> 
>>> 
>>> Adriano
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p23273638.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Update DropDownChoice with ModalWindow

Posted by PDiefent <pd...@csc.com>.
It's definitely not a hashCode/equals problem, because when the page is
rendered, the initial value of the dropDown is set correctly from the
PropertyModel. After coming back from the modal window the DropDownChoice
can't set the new value ...

asfernandes wrote:
> 
>> Looks like lack of hashCode/equals implementation for the type used.
>> I suffered from exactly problem as you initially described... But in my 
>> case, however, equals() was implemented to always return false, and 
>> DropDownChoice calls it. Perhaps, your problem is different, but I don't 
>> know if it can happen due to different instances of objects created by 
>> LoadableDetachableModel so you had to correctly override this method, or 
>> is a totally different thing...
>> 
>> 
>> Adriano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p22615156.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Update DropDownChoice with ModalWindow

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
PDiefent escreveu:
> Adriano, I don't know what you mean. In my point of view the
> LoadableDetachableModel representing the list with the names is updated, but
> the property model representing the actual name not.
> I'm using target.addComponent(nameDropDown) in the setWindowClosedCallback()
> method and I'm setting the actual name in the onSubmit() method of the
> AjaxSubmitLink in the modal window. But obviously there is something missing
> ...
> Looks like lack of hashCode/equals implementation for the type used.
I suffered from exactly problem as you initially described... But in my 
case, however, equals() was implemented to always return false, and 
DropDownChoice calls it. Perhaps, your problem is different, but I don't 
know if it can happen due to different instances of objects created by 
LoadableDetachableModel so you had to correctly override this method, or 
is a totally different thing...


Adriano


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


Re: Update DropDownChoice with ModalWindow

Posted by PDiefent <pd...@csc.com>.
Adriano, I don't know what you mean. In my point of view the
LoadableDetachableModel representing the list with the names is updated, but
the property model representing the actual name not.
I'm using target.addComponent(nameDropDown) in the setWindowClosedCallback()
method and I'm setting the actual name in the onSubmit() method of the
AjaxSubmitLink in the modal window. But obviously there is something missing
...
Looks like lack of hashCode/equals implementation for the type used.


Adriano


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




-- 
View this message in context: http://www.nabble.com/Update-DropDownChoice-with-ModalWindow-tp22595072p22601399.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Update DropDownChoice with ModalWindow

Posted by Adriano dos Santos Fernandes <ad...@uol.com.br>.
PDiefent escreveu:
> Hi,
> In my panel I have a DropDownChoice with names. An AjaxLink opens a
> ModalWindow where I can enter a new name. After submitting the modal window,
> the new name is stored in the database and the new entry is added to the
> DropDownChoice contents. All this works fine, but one problem remains: The
> new name doesn't show up in the DropDownChoice field, only "Choose value" is
> shown.
> Any suggestions?
Looks like lack of hashCode/equals implementation for the type used.


Adriano


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