p:commandButton在tabview中不起作用

时间:2014-11-13 12:23:52

标签: jsf-2 primefaces

我试图使用p:commandButton显示对话框,p:commandButton在tabView中。我试过这种方式,但没有成功,我错过了什么? THX

<p:tab  title="Observations">                   
    <div class="field select-field clearfix">                           
        <label>Bloc</label>
        <h:panelGroup layout="block" styleClass="actions">
            <h:form>
                <p:commandButton value="Add" styleClass="add"
                    action="#{blocCtrl.initBlocSetting}"
                    update=":dialog2" oncomplete="add_bloc.show()">
                </p:commandButton>
            </h:form>
        </h:panelGroup>
        <p:dialog id="dialog2" header="Bloc" modal="true"
            widgetVar="add_bloc" minHeight="40" width="895">
            <div class="popup-body">
                <h:form>                
                    <h:panelGroup layout="block"
                        styleClass="popup-field clearfix last">
                        <label class="the-label">Type bloc*</label>
                        <div class="the-field">
                            <h:inputText
                                value="#{blocCtrl.blocSettings.type}"
                                required="true"
                                requiredMessage="Error" />
                        </div>
                    </h:panelGroup>
                    <div class="popup-actions">
                        <button
                            onclick="$('.ui-dialog-titlebar-close').trigger('click');return false;"
                            class="red-btn">Annuler</button>
                        <h:commandButton value="OK" type="submit"
                            action="#{blocCtrl.addBlocSetting}"
                            update="add_messagePanel"
                            oncomplete="if(args &amp;&amp; args.success){add_bloc.hide();}"
                            styleClass="green-btn" />
                    </div>
                </h:form>
            </div>
        </p:dialog>
    </div>              

1 个答案:

答案 0 :(得分:1)

我遇到了同样的情况,在p:tabView之前删除了form标签后,它开始工作了

auto_now_add=True