サーバーサイド妥当性検査が失敗したらクライアントサイドのアラートを表示する方法

<xp:label id="label1">
    <xp:this.value><![CDATA[#{javascript:/** If there are any messages for this request, run the client-side JavaScript after the viewRoot response is completed **/
  if(facesContext.getMessages().hasNext()){
    var x="alert('THE DOCUMENT WAS NOT SAVED.\\n\\nAll required fields were not completed or they do not contain valid data.\\n\\nPlease review the fields and correct any errors.');";
    view.postScript(x);
  }}]]></xp:this.value>
</xp:label>





8.5.3 以降で有効。

JavaScript (Server)
katoman
August 19, 2015 2:20 PM
Rating
0





No comments yetLogin first to comment...