it is possible to change the mouse cursor's form into busy mode (for example: hourglass) when processing ajax button in JSF (specifically primefaces)? I want to change my cursor's form while my p:dataTable is loading data when i navigate it to the next page. Thanks.
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- java.lang.NullPointerException at java.io.PrintWri
- java.lang.NullPointerException at java.io.PrintWri
- Using :remote => true with hover event
- Is there a way to play audio on a mobile browser w
相关文章
- spring boot用ajax发送请求后,请求路径多了controller的路径
- 针对复杂结构的前端页面,如何更好地与后台交互实现动态网页?
- ajax上传图片,偶尔会出现后台保存的图片有错误或者已损坏,请问可能是什么原因造成的?
- 前端 我想知道怎样通过发ajax请求向服务器拿到数据然后分页显示 最好是点击一页就发一次请求
- 接口返回的数据格式如下,请问可以取到level值为2的name数组呢
- 如何通过页面输入账号密码提交给后端
- How to get jQuery.ajax response status?
- How to read local csv file in client side javascri
Primefaces by itself doesn't look like it does that. It has some components that allow you to visualize when its working (AjaxStatus, BlockUI), but it doesn't look like it does anything with the cursor.
You'd have to directly use Javascript to do that. This looks like a nice option.
change cursor to busy while page is loading
You can achieve this with a little help of CSS and jQuery. With CSS, you can create a class which changes the cursor on the entire document. With jQuery, you can add/remove that CSS class. Under the covers, PrimeFaces uses jQuery for the ajax magic and you can for PrimeFaces <4 hook on standard jQuery
ajaxStart
andajaxStop
events and for PrimeFaces 4+ hook on PrimeFaces specificpfAjaxSend
andpfAjaxComplete
events to perform the add/remove of that CSS class.CSS:
(the
!important
overrides any style set bystyle
attribute and stronger CSS selectors for the case that)jQuery and PrimeFaces:
For the case you're also using standard JSF
<f:ajax>
elsewhere and would like to have the same progress indicator, here's how you can do that:This is also used by OmniFaces showcase application. You can see it among others when you run the poll at this page.