Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XValuePath and Listgrid errors question

    I am having trouble extracting data via XValuePath when i have to go a level up.

    Code:
    setRecordXPath("/data");
    ids.setValueXPath("taxIds"); // this works fine
    errors.setValueXPath("../error"); // does NOT work, get null when extracting
    Is it possible to traverse a level up? When i do a listgrid fetch and backend returns a generic error like service is down, i want to display it in label right above the listgrid. Is my approach good? I know there are errors i can set on list grid fields, but this is more generic so i want to display for the entire list.

    #2
    It sounds like you're getting a request error that you want to show to the client - not any record-specific information.
    The right way to handle this is probably to override "transformResponse" in your datasource to catch this case and set an error status / apply the error status string returned by the server to the dsResponse.

    Then in the code that issues the fetch on the listGrid you can specify 'willHandleError' to true on the dsRequest, and have logic in the callback that checks for this error on the response and displays the error code in a label as you describe.

    Make sense?

    Comment

    Working...
    X