在p:confirmDialog上不调用方法

时间:2013-10-04 10:00:42

标签: jsf jsf-2 primefaces

我正在使用JSF 2.1 primefaces 3.5 我有p:datatable我编辑的每一行 - 删除commandLink,删除h:commandLink我用p:confirmDialog当我点击删除h:commandLink confirmDialog弹出,如果我按是commandButton动作方法没有调用.. 但是如果我把p:confirmDialog代码输出,那么表单方法调用就无法理解发生了什么

<h:body>
<p>hello</p>
<ui:composition template="/template/mastertemplate.xhtml">
    <ui:define name="content">
        <f:view>
            <div id="main">
                <div class="full_w" style="height: auto; max-width: 1150px; overflow: hidden;">
                <!--   <div class="full_w" style="height: auto; max-width: 1045px; overflow: hidden;"> -->
                    <div class="h_title"><p class="h_titleParagraph" style="margin: 0px;">Head of accounts</p></div>
                    <h:form styleClass="form" id="headOfAccountsForm">
                     <!--    <p:panel id="analysisTheBudgetPenel" header="Analysis The Budget">  -->
                            <div class="divPanel">
                                <div class="divContent">
                                    <div>
                                        <p:tabView id="headOfAccountsId_tabview">
                                            <p:tab title="Main Head Of Accounts" id="mainHeadOfAccountsId_tab">
<p:dataTable id="allMainHeadOfAccountsId_table" value="#{budgetHeadOfAccountsAction.budgetMainHeadOfAccountsBean.budgetMainHeadOfAccountsListBean}" var="budgetMainHeadOfAccountsList" rowIndexVar="allMainHeadOfAccounts_rowIndex">

//some columns
<p:column headerText="Edit">
<h:commandLink  id="deleteId_commandLink" value="delete" onclick="confirmation_widgetVar.show(); return false;" />  
</p:column>

</p:dataTable>
<p:confirmDialog header="Confirmation"  message="Do you want to delete this row?" widgetVar="confirmation_widgetVar">
                                                         <p:commandButton actionListener="#{budgetHeadOfAccountsAction.deleteMainHeadOfAccountsOnAjax}" value="Yes"  oncomplete="confirmation_widgetVar.hide();">
                                                                <f:setPropertyActionListener target="#{budgetMainHeadOfAccountsBean.budgetMainHeadOfAccountIdBean}" value="#{budgetMainHeadOfAccountsList.budgetMainHeadOfAccountIdBean}" />
                                                         </p:commandButton>
<p:commandButton value="No" onclick="confirmation_widgetVar.hide()" type="button" />
</p:confirmDialog>
// all others closing tags..

1 个答案:

答案 0 :(得分:2)

尝试使用像

这样的流程属性
<p:commandButton style="position:absolute;right:-150px;" process="@this" 

让我知道