set action set属性在primefaces jsf中不起作用

时间:2013-07-13 09:11:17

标签: jsf primefaces

您好我正在使用命令按钮来设置属性Action lisnter但是它没有被调用这里选择的值bean没有被更新,请帮我,我想在对话框中显示所选项目,但它显示为空..是代码下面。

<p:commandButton icon="ui-icon-search" update=":form:appDetail" 
                oncomplete="appDialog.show()" title="View Detail">
                <f:setPropertyActionListener value="#{applicant}"
                    target="#{tableBean.selectedApplicant}" /></p:commandButton>
背后的课程是:

package com.DTO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;

@ManagedBean
@SessionScoped
public class TableBean implements Serializable {

    private List<InterViewDto> applicantlist;
    private InterViewDto selectedApplicant;

    public List<InterViewDto> getApplicantlist() {
        return applicantlist;
    }

    public void setApplicantlist(List<InterViewDto> applicantlist) {
        this.applicantlist = applicantlist;
    }

    public InterViewDto getSelectedApplicant() {
        return selectedApplicant;
    }

    public void setSelectedApplicant(InterViewDto selectedApplicant) {

        this.selectedApplicant = selectedApplicant;

    }

    public TableBean() {

        applicantlist = new ArrayList<InterViewDto>();
        InterViewDto p1 = new InterViewDto();
        p1.setJobtitle("junaid");
        p1.setUseremail("email@hotmail.com");
        applicantlist.add(p1);

    }

    public void check(){

        System.out.print("hi");
    }

}

0 个答案:

没有答案