且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ajax在Primefaces中更新JavaScript脚本

更新时间:2023-02-11 13:36:38

将其放入JSF标记中,并赋予其ID.

put it in a JSF tag, and give it Id.

<h:panelGroup id="myScript">
   <script type="text/javascript">

     function lineChartExtender(){
         this.cfg.highlighter = {
             showTooltip: true,
             tooltipAxes: 'both',
             tooltipLocation: 'n'
        };
         this.cfg.seriesDefaults = {
                 showMarker: #{query.stringMarker}
         };
      }       
    </script>
</h:panelGroup>

,并具有执行某些操作或不执行某些操作的按钮或链接,并更新此< h:panelGroup>

and have a button or link that does some action, or not, and updates this <h:panelGroup>

<h:commandLink action="#{myBean.doSomething}" update="myScript"/>