Hi Martin,

I think that I do it in:

CharSequence handler = "$(\"#content\").text(data.offices[0].officeCode)";

public CharSequence getSuccessHandler(Component component) {
                                        return handler;
}

I tested access the JSON Response directly in method
onClick(AjaxRequestTarget target), something like this:

private JSONObject offices;
public void onClick(AjaxRequestTarget target){
                        try {
                                this.offices = OfficeDAO.getAllOfficeJSON();
                        } catch (SQLException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (JSONException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                        TextRequestHandler trh = new 
TextRequestHandler("application/json",
"UTF-8", offices.toString());
                        getRequestCycle().replaceAllRequestHandlers(trh);
        }

So, in this way, I can access the content of the JSON response (attribute
offices) and show it in the div. However, i want to access it using the URL,
because, if an error occurs, i willl redirect the request to another server.

Thanks,
Anderson



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handle-JSON-response-tp4656838p4656867.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to