命令按钮动作不叫JSF + Spring

时间:2017-11-24 07:29:08

标签: spring jsf

我有以下情况:

 <div class="row uniform">
                            <div class="12u">

                                <h:selectOneMenu id="mcm3" value="#{evaluateIdeaBean.committeeMemberEntity}"
                                                 styleClass="form-control"
                                                 requiredMessage="#{msg['global.msg.error.noInput']}">
                                    <f:selectItem itemLabel="Seçiniz" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems value="#{evaluateIdeaBean.allCMember}" var="committeeMember" itemLabel="#{committeeMember.user.fullName}" itemValue="#{committeeMember}"/>
                                </h:selectOneMenu>
                            </div>
                        </div>

                                <!-- end of 2 -->
                        <div class="row uniform">
                            <div class="12u">
                                <ul class="actions" style="float:right;">

                                        <p:commandButton value="#{msg['btn.add']}"
                                                         icon="fa fa-plus"
                                                         ajax="false"
                                                         actionListener="#{evaluateIdeaBean.oneCommitteeMember}"
                                                         update="commiteMemberTable"
                                                         styleClass="noprint button small special_blue"
                                                         style="padding: 0 0.5em">
                                        </p:commandButton>
                                    </ul>
                            </div>
                        </div>

当我单击按钮时,方法loginAction(),来自我的bean,它不会在这里提交代码,

方法;

 public void oneCommitteeMember() {
    System.out.println("Ben buraya geldim");
    Evaluation tempEv;
    tempEv = evaluationService.findEvaluationByIdeaAndMember(ideaEntity,committeeMemberEntity);
    System.out.println(committeeMemberEntity.getUser().getFullName());
    if(tempEv==null) {
        tempEv=new Evaluation();
        tempEv.setCommitteeMember(committeeMemberEntity);
        tempEv.setIdea(ideaEntity);
        tempEv.setEvaluationDate();
        evaluationService.saveOrUpdate(tempEv);
        mailList.add(committeeMemberEntity.getUser().getEmail());
        Set<String> uniqueMailList = new HashSet<>();
        uniqueMailList.addAll(mailList);
        mailList.clear();
        mailList.addAll(uniqueMailList);

        // Send email to all committee members
        emailService.sendMail(mailList.toArray(new String[mailList.size()]),
                new String[0],
                properties.getMailSubject(this.getClass(), "02"),
                MessageFormat.format(properties.getMailBody(this.getClass(), "02"), ideaEntity.getTitle(), ideaEntity.getId()));
    }
    else{
        System.out.println("");
    }
}

在这种情况下,当我按下命令按钮时,方法oneCommitteeMember()没有被调用,我不明白为什么。

我正在使用jsf,primafaces,spring 谢谢

0 个答案:

没有答案