you have to add the feedbackpanel to the ajax target. you should also
override onerror() in the ajax submit behavior and do the same there.

as far as submitting on enter you will need to write some javascript
probably for textfield's onkeydown event, check for enter key, and
execute: this.form.submit();

-igor


On Thu, May 1, 2008 at 1:12 PM, Ryan O'Hara <[EMAIL PROTECTED]> wrote:
> I'm having trouble getting messages to display in the FeedbackPanel.  Also,
> any idea how to get the form to submit after the user presses enter/return
> in a textfield (when using AjaxSubmitLink)?  Any ideas?  Below is my code.
>
>        //feedbackPanel
>         FeedbackPanel feedbackPanel = new FeedbackPanel("feedbackPanel");
>         feedbackPanel.add(new AttributeModifier("class", true, new
> Model("feedbackPanel")));
>         feedbackPanel.setFilter(new ContainerFeedbackMessageFilter(form));
>         form.add(feedbackPanel);
>         form.add(new TextField("name"));
>
>         //submit button
>
>         AjaxSubmitLink submit = new AjaxSubmitLink("submit") {
>             public void onSubmit(AjaxRequestTarget target, Form form) {
>                 try {
>                     groupsDisplay.add(new AttributeModifier("class", true,
> new Model("groupsDisplay")));
>                     target.addComponent(groupsDisplay);
>                     info("Groups for " + name + ".");
>                 } catch (Exception e) {
>                     error("Unable to get groups for " + name + ".");
>                 }
>             }
>         };
>         form.add(submit);
>
>  Thanks,
>  Ryan
>
>  ---------------------------------------------------------------------
>  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]

Reply via email to