1 //This method is executed when user clicks on job table row 2 public void JobTableSelectionLsnr(SelectionEvent selectionEvent) 3 { //This method is invoked to render the popup after executing the view query 4 //for ADF Pop UP, here p1 represents the popup object 5 invokePopup(p1.getClientId(FacesContext.getCurrentInstance())); 6 } 7 8 private void invokePopup(String popupId) { 9 System.out.println("invokePopup: " + popupId); 10 //This method is used to execute detail view dynamically 11 executeView(); 12 //This block is used to render the popup 13 if (popupId != null) { 14 ExtendedRenderKitService service = 15 Service.getRenderKitService(FacesContext.getCurrentInstance(), 16 ExtendedRenderKitService.class); 17 18 StringBuffer showPopup = new StringBuffer(); 19 showPopup.append("var hints = new Object();"); 20 showPopup.append("var popupObj=AdfPage.PAGE.findComponent('" + 21 popupId + "'); popupObj.show(hints);"); 22 service.addScript(FacesContext.getCurrentInstance(), 23 showPopup.toString()); 24 } 25 } 26 // this method is used to execute the view 27 private void executeView() { 28 BindingContainer bc = 29 BindingContext.getCurrent().getCurrentBindingsEntry(); 30 OperationBinding ob = 31 (OperationBinding)bc.getOperationBinding("getEmployeeByJobTitle"); 32 ob.getParamsMap().put("jobtitle", 33 getTableSelectedRow("JobsView1Iterator", 34 "JobTitle")); 35 ob.execute(); 36 } 37 //This method is used to get the selected job title form the master table 38 private String getTableSelectedRow(String iteratorName, 39 String columnname) { 40 String selectedVal = null; 41 DCBindingContainer dc = 42 (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 43 DCIteratorBinding dciter = dc.findIteratorBinding(iteratorName); 44 RowSetIterator rowsetiter = dciter.getRowSetIterator(); 45 46 RowKeySet rks = t3.getSelectedRowKeys(); 47 Iterator rowkeysetiterator = rks.iterator(); 48 49 while (rowkeysetiterator.hasNext()) { 50 Key rowkey = (Key)((List)rowkeysetiterator.next()).get(0); 51 Row row = rowsetiter.getRow(rowkey); 52 selectedVal = row.getAttribute(columnname).toString(); 53 } 54 return selectedVal; 55 }