我正在尝试了解流动请求是如何工作的,我是 primeFaces 的新手,所以如果这是一个太基本的问题,请原谅。
- 该请求将 ID 和出生日期发送到服务器,但我不明白它是如何工作的(
onclick
、onstart
...)。 PrimeFaces.ab
和PrimeFaces.cw
之间有什么区别?
<button id="scheduleForm:tabViewId:searchIcon" name="scheduleForm:tabViewId:searchIcon" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" onclick="PrimeFaces.ab({source:'scheduleForm:tabViewId:searchIcon',
update:'scheduleForm:tabViewId:panelInfoPessoal scheduleForm:postPanelGroup scheduleForm:postcons scheduleForm:infoAgendamento scheduleForm:listaAtos scheduleForm:preRegPanelGroup scheduleForm:SGCMessage',
onstart:function(cfg){loadingDlg.show();},oncomplete:function(xhr,status,args){loadingDlg.hide();;}});return false;" style="align: right; width: 20%; min-width: 120px;vertical-align: middle;margin:0 auto" type="submit"><span class="ui-button-text">Pesquisar</span></button><script id="scheduleForm:tabViewId:searchIcon_s" type="text/javascript">PrimeFaces.cw('CommandButton',
'widget_scheduleForm_tabViewId_searchIcon',{id:'scheduleForm:tabViewId:searchIcon'});</script></div><div id="scheduleForm:tabViewId:tab_gov" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-helper-hidden" role="tabpanel" aria-hidden="true"><table id="scheduleForm:tabViewId:panelLogin" style="text-align: center; font-size: 12pt; vertical-align: middle; margin:0 auto; padding-top: 1%; padding-bottom: 2%;">
最佳答案
PrimeFaces Ajax API 记录在此处 https://primefaces.github.io/primefaces/10_0_0/#/core/ajaxJavascriptApi在这里 https://primefaces.github.io/primefaces/jsdocs/modules/src_primefaces.primefaces.ajax.html
PrimeFaces.ab
是处理 Ajax 请求的 PrimeFaces.ajax.Request.handle
的缩写。
PrimeFaces.cw
是 PrimeFaces.createWidget
的缩写,它将创建一个小部件(大多数 PrimeFaces 组件都使用它,基本上是组件实例的 JavaScript API)。
作为 PrimeFaces 组件的用户,您不需要了解核心 JavaScript 的所有来龙去脉。它将在更复杂的场景中有所帮助,但作为初学者,我不会关注这一点。
首先,我建议您先阅读 Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes .
关于javascript - PrimeFaces 渲染的所有 JavaScript 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66994194/