日期:2014-05-16 浏览次数:20596 次
//调pop画面按钮,触发ajax事件
<td align="left">
???? <p:inputText?value="#{spp210Bean.m_Supplier.supplier_Sort_Name}" />
???? <h:graphicImage library="images" name="popup_1.png"?? onclick="getValue();" />
</td>
?
// getValue方法取得ajax对象,变更对象值,触发ajax
???function getValue(){
????var SUPPLIER_SORT_CODE1 = document.getElementById("spp210Form:SUPPLIER_SORT_CODE1");
????var plan_List_Id = "100000000000016,100000000000017,100000000000018,";
????var branch_Code = " ";
????var branch_Name = " ";
????SUPPLIER_SORT_CODE1.value = plan_List_Id+";"+branch_Code+";"+branch_Name+";";
????jQuery(SUPPLIER_SORT_CODE1).change();
????
???}
?
?
//ajax方法:
当触发ajax方法时,将参数传到后台bean中的stringParms变量并调用pageSet方法,完成时调用前台branchPopup方法
<h:inputText style="display:none" id="SUPPLIER_SORT_CODE1" value="#{ppn712Bean.stringParms}" >
??????<p:ajax event="change" process="@all" listener="#{ppn712Bean.pageSet}"
????? update="backval"?oncomplete="branchPopup('PPN712.xhtml',
???? '{RES.PPN510_BTN_CONT_MAKE}',?? 600, 1000);return false;"/>
</h:inputText>
?
?
// ajax方法完成时调用branchPopup方法打开页面
???function branchPopup(){
????window.open('xxx.xhtml','睂訆商','height=600,width=1000,top=' + ((window.screen.height - 600) / 2 - 15) + ',left=' + ((window.screen.width - 1000) / 2 - 5)+ ',toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
????return false;
????
???}
?
?// BEAN中设置
?// ajax传递参数?
?private String stringParms;
?
?public void pageSet(){
??
??String[] stringParmsArr = stringParms.split(";");
??String plan_List_Id = stringParmsArr[0];
??ppn712ViewBean.setPlan_List_Id(plan_List_Id.trim());
??branch_Code = stringParmsArr[1].trim();
?
??branch_Name = stringParmsArr[2].trim();
??
?}
?
?