這邊我來介紹一下如何運用 Javascript 的技巧開啟一個新的視窗
當然 ZK 也能夠支援 Javascript 的運作
再運用 Javascript 開心視窗時,程式通常如下
window.open('目標 URL', '', ''); 總共可帶三個參數進去
延續之前的例子,當 User select 某個 item 的時候就要開新一個視窗的話
可以在 listbox 的 onSelect 時,執行你所需要的 Javascript
程式大致如下 :
<attribute name="onSelect">
<![CDATA[
String acc_id = Executions.getCurrent().getDesktop().getAttribute("select_id");
String acc_name = Executions.getCurrent().getDesktop().getAttribute("select_name");
String userId = Executions.getCurrent().getDesktop().getAttribute("loginId");