Thanks Martin, I am still learning so AbstractAjaxBehavior was my first choice. No reason...
I have changed it to AbstractDefaultAjaxBehavior and added the following code to the respond method. target.addComponent(feedback); error(errorMessage); However I still receiving the same WARNING message. Layout Page - feedback - form - TextFields - AbstractDefaultAjaxBehavior has been added here. I must missing something very basic. On 05/10/2011, at 5:57 PM, Martin Grigorov wrote: > Hi, > > Why do you use AbstractAjaxBehavior instead of AbstractDefaultAjaxBehavior? > > AbstractDefaultAjaxBehavior passes you an instance of > AjaxRequestTarget which you can use to add the feedback panel and show > the feedback message. It writes a special XML back to the browser > which wicket-ajax.js (e.g. wicketAjaxPost()) knows how to read and > uses it to update the components. > > AbstractAjaxBehavior is a bit more general Ajax behavior with which > you can write back to the response any kind of response (e.g. JSON). > > If you need both kind of responses then I suggest you to use > AbstractDefaultAjaxBehavior to update components (target.add()) and > target.appendJavaScript(someJSONP) > > On Wed, Oct 5, 2011 at 10:38 AM, Tate Jones <t...@bluedog.com.au> wrote: >> Hi Group, >> >> I have added a AbstractAjaxBehavior to WebPage to recieve a 'post' request >> from JavaScript (.ajax post). During the onRequest method an error could >> occur and I want to display this in the FeedbackPanel. When I attempt to >> use the error(..) or info(..) method the following WARNING appears in the >> console. >> >> WARNING: Component-targetted feedback message was left unrendered. This >> could be because you are missing a FeedbackPanel on the page. Message: >> [FeedbackMessage message = "to be display in feedback panel", reporter = 2, >> level = ERROR] >> >> I already have a working Feedback panel on the page for a basic button >> submit method. >> >> code fragment. >> >> @AuthorizeInstantiation(Roles.ADMIN) >> public class AdminPage extends WebPage { >> >> private static final long serialVersionUID = 1L; >> private static final Logger log = LoggerFactory.getLogger(WebPage.class); >> >> public AdminPage() { >> >> add(new FeedbackPanel("feedback")); >> >> >> Form form = new Form("adminForm", new >> CompoundPropertyModel(tuneChip)); >> add(form); >> >> form.add(new RequiredTextField("description")); >> >> AbstractAjaxBehavior ajaxPostBehaviour = new >> AbstractAjaxBehavior() { >> private static final long serialVersionUID = 1L; >> >> @SuppressWarnings("unchecked") >> public void onRequest() { >> /**….. >> some logic. The something goes wrong... >> …..**/ >> >> error("Report Error Message"); >> } >> }; >> add(ajaxPostBehaviour); >> >> What is the best way to bind AbstractAjaxBehavior to the FeedbackPanel or >> should I used another approach? As mentioned I am using >> AbstractAjaxBehavior to received a 'post' request. >> >> eg. >> "$.ajax({ " + >> "url: '" + callBackURL + "'," + >> "type: 'post'," + >> …etc.. >> >> Tate >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.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