JSF2.0 - Handling erroneous Ajax calls with Primefaces 3.0

后端 未结 1 546
余生分开走
余生分开走 2020-12-21 06:39

I have a commandButton in my .xhtml page:



        
相关标签:
1条回答
  • 2020-12-21 06:47

    onerror calls this function:
    onerror(xhr, status, exception) - Javascript callback to process when ajax request fails. Takes three arguments, xmlhttprequest, status string and exception thrown if any.
    This info is from documentation. xhr - is actually a request. So there can be found request status and a lot of other info.

    <p:commandButton action="#{someone.doSomething()}"
                ajax="true"
                onerror="console.debug(xhr)">
    </p:commandButton>
    

    Try this code in chrome or firebug. It will show xhr object

    Get a look into http://primefaces.googlecode.com/files/primefaces_users_guide_3_0.pdf section 7.2 Ajax API

    0 讨论(0)
提交回复
热议问题