I think i have figured out the problem but I am not sure why it did not work
in my original code.

In the original code I have Page 1
in page one I have a Feedbackpanel, a RequiredTextfield and a modal. The
Textfield has a property model and i want this particular testfield to use
"name" from that model.

now the modalwindow on page one has a setWindowClosedCallback() like this

modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
                public void onClose(AjaxRequestTarget target) {
                    target.addComponent(nameField);
                }
            });

where nameField is the name of my required testfield.

The modal opens up page 2. I pass the model for the propertymodel from the
textfield to page 2. When the user makes a select and clicks submit I call a
model.setName=list.getValue(). and I close the modal.

This will set the name in the model to the name I selected. NOw the
windowclosecallback should refresh the textfield because of my code above.

This works unless I try to move on with out first assigning a name. IF I try
to move on with out assigning a name the feedbackpanel tell me a name is
required. If I then click on the button to open the modal which contains
page 2 everything goes as planned but when the modal is closed the textfield
is given a blank value. I know it is blank because I can see it in the ajax
debug.

I am not sure why I am getting a blank value but to fix it I simple moved
the setWindowClosedCallback from page one to page 2 in the onsubmit part of
the form. Instead of passing the model I am passing the window and I can
simply say window.setWindowClosedCallback and and set the ModelObject there.

Anyway this works for me but I am still curious as to why my previous code
did not work. If you have any ideas I would appreciate it

Thanks

T

Nino.Martinez wrote:
> 
> Could you create a quickstart?
> 
> taygolf wrote:
>> Nope I am not getting an error in the ajax debug. From what I can see the
>> popup is sending back the correct value when I go through my normal steps
>> but when I have the feedback panel come up and then bring up the popup I
>> am
>> allowed to select my choice but the popupmodal window is sending back a
>> blank value. I wonder why. I am really stumped on this one. Any help
>> would
>> be greatly appreciated.
>>
>> T
>>
>>
>>
>> Mr Mean wrote:
>>   
>>> Can you take a look in the ajax debug window to see if you get an error?
>>>
>>> Maurice
>>>
>>> On Mon, Apr 14, 2008 at 4:35 PM, taygolf <[EMAIL PROTECTED]>
>>> wrote:
>>>     
>>>>  Hey guys. I am not sure that this has anything to do with the feed
>>>> back
>>>> panel
>>>>  or not but I wanted to mention it.
>>>>
>>>>  Here is what I have. I have a modal window with required textfields in
>>>> it.
>>>>  The textfields have another modal window that creates a 'popup' and
>>>> the
>>>> user
>>>>  selects the value they want entered into the requiredtextfield.
>>>>
>>>>  When the user opens the first modal window they see the required
>>>> textfields.
>>>>  when they click on the button to open the second modal window the user
>>>> sees
>>>>  their options in a select list. They select one and hit submit and the
>>>>  textfield is populated with their choice vie ajax.
>>>>
>>>>  The problem I have is what happens when the user trys to submit the
>>>> first
>>>>  modal window with out filling out the required textfield. I have a
>>>> feedback
>>>>  panel that popups up and tells the user that the must selct a user
>>>> name.
>>>>
>>>>  After the feedback panel is shown the user will click on the button to
>>>> show
>>>>  second modal window. Again their choices appear in a modal window.
>>>> They
>>>> can
>>>>  select one and hit submit just like before but this time the textfield
>>>> is
>>>>  not populated.
>>>>
>>>>  So the question is why does it do this. It works great until there is
>>>> an
>>>>  error in the modal window and then everything goes to hell. I have to
>>>>  require the testfield so I can not just remove the requirement. What
>>>> is
>>>> the
>>>>  problem here.  I am sure it is something simple I have over looked
>>>>
>>>>  Thanks
>>>>
>>>>  T
>>>>  --
>>>>  View this message in context:
>>>> http://www.nabble.com/MOdal-window-feedback-panel-something-strange-is-going-on-tp16678101p16678101.html
>>>>  Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>       
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>     
>>
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/MOdal-window-feedback-panel-something-strange-is-going-on-tp16678101p16702611.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to