How can I pass selected row to commandLink inside dataTable or ui:repeat?

前端 未结 4 1825
情话喂你
情话喂你 2020-11-21 06:29

I\'m using Primefaces in a JSF 2 application. I have a , and instead of selecting rows, I want the user to be able to directly execute variou

4条回答
  •  我寻月下人不归
    2020-11-21 06:59

    In my view page:

    
    
    
        
        
    
    
    
    

    backing bean

     public void viewDetail(ActionEvent e) {
    
        String trxNo = getFacesContext().getRequestParameterMap().get("trxNo");
    
        for (DTO item : list) {
            if (item.get("trxNo").toString().equals(trxNo)) {
                System.out.println(trxNo);
                setSelectedItem(item);
                break;
            }
        }
    }
    

提交回复
热议问题