You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sureshram <sr...@gmail.com> on 2008/10/28 22:29:24 UTC

Feedback Panel on Modal Window With Field Validation does not work

Hello,

  I am trying to add auto validation in the modal window but I don't see any
error messages. I added a feedback panel on a modal window which has a
required text field.  When I try to submit, the modal window does not do any
thing and I think what happens here is wicket does validation (which is
failing) and does not submit the form. It does not show error messages in
the feedbackpanel also.

public class AddAccountModalWindow extends ModalWindow {

	public AddAccountModalWindow(String id) throws Exception {
		super(id);
		setInitialHeight(450);
		setInitialWidth(500);
		
		setTitle("Add New Account");
		AddAccountContentPanel newAccPanel = new AddAccountContentPanel("content")
{		    
			private static final long serialVersionUID = 1L;

			void onCancel(AjaxRequestTarget target) {
				close(target);
		    }

		};
		setContent(newAccPanel);

    };

}

public abstract class AddAccountContentPanel extends Panel {

public AddAccountContentPanel(String id) throws Exception {
                Form accForm = new Form("accForm");
		accForm.setOutputMarkupId(true);
		setModel(new Model(""));
		add(accForm);
		
		feedbackPanel = new FeedbackPanel("feedback", new
ContainerFeedbackMessageFilter(accForm));
		accForm.add(feedbackPanel);

                TextField  accName = new TextField("accName", new
PropertyModel(clearingAccount, "mnemonic"));

               AjaxFallbackButton createAccount = new
AjaxFallbackButton("createAccount", accForm){
                         protected void onSubmit(AjaxRequestTarget target,
Form form) {
                        //hidden code here.....
                         }
               }
              accForm.add(accName);
              accForm.add(createAccount);

}

}

========= AddAccountContentPanel.html

<html>
<body style="background-color:#bbd1ef">
<wicket:panel>
<wicket:panel>

<form wicket:id="accForm" style="background-color:#bbd1ef">
<div style=" float:left;" >
	<div style="margin: 20px 0 0 20px;float:left" wicket:id="feedback"></div>
	<div style="clear:both"></div>
	<div style="margin: 20px 0 0 20px;float:left">
		 Account Name: 
		<input style="font:16px Calibri; margin-left:10px;" type="text"
wicket:id="accName"/>
	</div>
div>
		<input style="font: 16px Calibri; margin: 20px 0 0 120px;"
wicket:id="createAccount" type="submit" value="Add Account" />
		
	</div>
</div>
</form>

</wicket:panel>

========= AddAccountModalWindow.html

<html>

<body style="background-color:#bbd1ef">
	<wicket:panel>
		<div wicket:id="content" style="background-color:#bbd1ef; width:100%;
height: 100%"></div>
	</wicket:panel>
</body>
</html>



</body>
</html>

I apprciate your help,

Thanks
Suresh


-- 
View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20216419.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: Feedback Panel on Modal Window With Field Validation does not work

Posted by sureshramakrishnaiah <sr...@gmail.com>.
Ok found the solution myself, The problem was In the AjaxFallBackButton I had
not overriden the onError() method, here's the solution added,


onError(AjaxTarget target, Form form) {
  target.addComponent(feedbackPanel);
}


sureshramakrishnaiah wrote:
> 
> I tried with a modal window and page, still no luck,  I do see validation
> happening in the server but I don't see that response coming back to the
> client
> 
> 
> 12:20:12,263 DEBUG [ComponentStringResourceLoader] Found resource from:
> org/apache/wicket/Application.properties; key: R
> equired
> 12:20:12,263 DEBUG [FeedbackMessages] Adding feedback message
> [FeedbackMessage message = "Field 'text' is required.", re
> porter = text, level = ERROR]
> 
> The Ajax Debug Window shows the following response, I don't see any error
> message sent back to the window.
> 
> <?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>
> 
> Note the Submit button on the modal window is a ajaxfallback button, is
> this causing any problems?
> 
> Any clue?
> 
> 
> sureshramakrishnaiah wrote:
>> 
>> Sorry I meant can we add a page to a modal window
>> 
>> 
>> 
>> 张伟-4 wrote:
>>> 
>>> try page not panel
>>> 
>>> 2008/10/29 sureshram <sr...@gmail.com>
>>> 
>>>>
>>>> Hello,
>>>>
>>>>  I am trying to add auto validation in the modal window but I don't see
>>>> any
>>>> error messages. I added a feedback panel on a modal window which has a
>>>> required text field.  When I try to submit, the modal window does not
>>>> do
>>> 
>>> 
>>> 
>> 
>> 
>> 
> 
> 


-----
Suresh Ramakrishnaiah
Lead Software Engineer
-- 
View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20232299.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: Feedback Panel on Modal Window With Field Validation does not work

Posted by sureshramakrishnaiah <sr...@gmail.com>.
I tried with a modal window and page, still no luck,  I do see validation
happening in the server but I don't see that response coming back to the
client


12:20:12,263 DEBUG [ComponentStringResourceLoader] Found resource from:
org/apache/wicket/Application.properties; key: R
equired
12:20:12,263 DEBUG [FeedbackMessages] Adding feedback message
[FeedbackMessage message = "Field 'text' is required.", re
porter = text, level = ERROR]

The Ajax Debug Window shows the following response, I don't see any error
message sent back to the window.

<?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>

Note the Submit button on the modal window is a ajaxfallback button, is this
causing any problems?

Any clue?


sureshramakrishnaiah wrote:
> 
> Sorry I meant can we add a page to a modal window
> 
> 
> 
> 张伟-4 wrote:
>> 
>> try page not panel
>> 
>> 2008/10/29 sureshram <sr...@gmail.com>
>> 
>>>
>>> Hello,
>>>
>>>  I am trying to add auto validation in the modal window but I don't see
>>> any
>>> error messages. I added a feedback panel on a modal window which has a
>>> required text field.  When I try to submit, the modal window does not do
>> 
>> 
>> 
> 
> 
> 


-----
Suresh Ramakrishnaiah
Lead Software Engineer
-- 
View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20231857.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: Feedback Panel on Modal Window With Field Validation does not work

Posted by sureshram <sr...@gmail.com>.
Sorry I meant can we add a page to a modal window



张伟-4 wrote:
> 
> try page not panel
> 
> 2008/10/29 sureshram <sr...@gmail.com>
> 
>>
>> Hello,
>>
>>  I am trying to add auto validation in the modal window but I don't see
>> any
>> error messages. I added a feedback panel on a modal window which has a
>> required text field.  When I try to submit, the modal window does not do
> 
> 
> 


-- 
View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20228860.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: Feedback Panel on Modal Window With Field Validation does not work

Posted by sureshram <sr...@gmail.com>.
can I add a panel to modal window, I thought?


张伟-4 wrote:
> 
> try page not panel
> 
> 2008/10/29 sureshram <sr...@gmail.com>
> 
>>
>> Hello,
>>
>>  I am trying to add auto validation in the modal window but I don't see
>> any
>> error messages. I added a feedback panel on a modal window which has a
>> required text field.  When I try to submit, the modal window does not do
>> any
>> thing and I think what happens here is wicket does validation (which is
>> failing) and does not submit the form. It does not show error messages in
>> the feedbackpanel also.
>>
>> public class AddAccountModalWindow extends ModalWindow {
>>
>>        public AddAccountModalWindow(String id) throws Exception {
>>                super(id);
>>                setInitialHeight(450);
>>                setInitialWidth(500);
>>
>>                setTitle("Add New Account");
>>                AddAccountContentPanel newAccPanel = new
>> AddAccountContentPanel("content")
>> {
>>                        private static final long serialVersionUID = 1L;
>>
>>                        void onCancel(AjaxRequestTarget target) {
>>                                close(target);
>>                    }
>>
>>                };
>>                setContent(newAccPanel);
>>
>>    };
>>
>> }
>>
>> public abstract class AddAccountContentPanel extends Panel {
>>
>> public AddAccountContentPanel(String id) throws Exception {
>>                Form accForm = new Form("accForm");
>>                accForm.setOutputMarkupId(true);
>>                setModel(new Model(""));
>>                add(accForm);
>>
>>                feedbackPanel = new FeedbackPanel("feedback", new
>> ContainerFeedbackMessageFilter(accForm));
>>                accForm.add(feedbackPanel);
>>
>>                TextField  accName = new TextField("accName", new
>> PropertyModel(clearingAccount, "mnemonic"));
>>
>>               AjaxFallbackButton createAccount = new
>> AjaxFallbackButton("createAccount", accForm){
>>                         protected void onSubmit(AjaxRequestTarget target,
>> Form form) {
>>                        //hidden code here.....
>>                         }
>>               }
>>              accForm.add(accName);
>>              accForm.add(createAccount);
>>
>> }
>>
>> }
>>
>> ========= AddAccountContentPanel.html
>>
>> <html>
>> <body style="background-color:#bbd1ef">
>> <wicket:panel>
>> <wicket:panel>
>>
>> <form wicket:id="accForm" style="background-color:#bbd1ef">
>> <div style=" float:left;" >
>>        <div style="margin: 20px 0 0 20px;float:left"
>> wicket:id="feedback"></div>
>>        <div style="clear:both"></div>
>>        <div style="margin: 20px 0 0 20px;float:left">
>>                 Account Name:
>>                <input style="font:16px Calibri; margin-left:10px;"
>> type="text"
>> wicket:id="accName"/>
>>        </div>
>> div>
>>                <input style="font: 16px Calibri; margin: 20px 0 0 120px;"
>> wicket:id="createAccount" type="submit" value="Add Account" />
>>
>>        </div>
>> </div>
>> </form>
>>
>> </wicket:panel>
>>
>> ========= AddAccountModalWindow.html
>>
>> <html>
>>
>> <body style="background-color:#bbd1ef">
>>        <wicket:panel>
>>                <div wicket:id="content" style="background-color:#bbd1ef;
>> width:100%;
>> height: 100%"></div>
>>        </wicket:panel>
>> </body>
>> </html>
>>
>>
>>
>> </body>
>> </html>
>>
>> I apprciate your help,
>>
>> Thanks
>> Suresh
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20216419.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20228747.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: Feedback Panel on Modal Window With Field Validation does not work

Posted by 张伟 <wi...@gmail.com>.
try page not panel

2008/10/29 sureshram <sr...@gmail.com>

>
> Hello,
>
>  I am trying to add auto validation in the modal window but I don't see any
> error messages. I added a feedback panel on a modal window which has a
> required text field.  When I try to submit, the modal window does not do
> any
> thing and I think what happens here is wicket does validation (which is
> failing) and does not submit the form. It does not show error messages in
> the feedbackpanel also.
>
> public class AddAccountModalWindow extends ModalWindow {
>
>        public AddAccountModalWindow(String id) throws Exception {
>                super(id);
>                setInitialHeight(450);
>                setInitialWidth(500);
>
>                setTitle("Add New Account");
>                AddAccountContentPanel newAccPanel = new
> AddAccountContentPanel("content")
> {
>                        private static final long serialVersionUID = 1L;
>
>                        void onCancel(AjaxRequestTarget target) {
>                                close(target);
>                    }
>
>                };
>                setContent(newAccPanel);
>
>    };
>
> }
>
> public abstract class AddAccountContentPanel extends Panel {
>
> public AddAccountContentPanel(String id) throws Exception {
>                Form accForm = new Form("accForm");
>                accForm.setOutputMarkupId(true);
>                setModel(new Model(""));
>                add(accForm);
>
>                feedbackPanel = new FeedbackPanel("feedback", new
> ContainerFeedbackMessageFilter(accForm));
>                accForm.add(feedbackPanel);
>
>                TextField  accName = new TextField("accName", new
> PropertyModel(clearingAccount, "mnemonic"));
>
>               AjaxFallbackButton createAccount = new
> AjaxFallbackButton("createAccount", accForm){
>                         protected void onSubmit(AjaxRequestTarget target,
> Form form) {
>                        //hidden code here.....
>                         }
>               }
>              accForm.add(accName);
>              accForm.add(createAccount);
>
> }
>
> }
>
> ========= AddAccountContentPanel.html
>
> <html>
> <body style="background-color:#bbd1ef">
> <wicket:panel>
> <wicket:panel>
>
> <form wicket:id="accForm" style="background-color:#bbd1ef">
> <div style=" float:left;" >
>        <div style="margin: 20px 0 0 20px;float:left"
> wicket:id="feedback"></div>
>        <div style="clear:both"></div>
>        <div style="margin: 20px 0 0 20px;float:left">
>                 Account Name:
>                <input style="font:16px Calibri; margin-left:10px;"
> type="text"
> wicket:id="accName"/>
>        </div>
> div>
>                <input style="font: 16px Calibri; margin: 20px 0 0 120px;"
> wicket:id="createAccount" type="submit" value="Add Account" />
>
>        </div>
> </div>
> </form>
>
> </wicket:panel>
>
> ========= AddAccountModalWindow.html
>
> <html>
>
> <body style="background-color:#bbd1ef">
>        <wicket:panel>
>                <div wicket:id="content" style="background-color:#bbd1ef;
> width:100%;
> height: 100%"></div>
>        </wicket:panel>
> </body>
> </html>
>
>
>
> </body>
> </html>
>
> I apprciate your help,
>
> Thanks
> Suresh
>
>
> --
> View this message in context:
> http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20216419.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
>
>