Retrieving the value of a clicked row in a data table

The getClickedRowValue snippet in the EGL drawer of the Snippets view is a function that retrieves the hyperlinked value of a clicked row in a data table.
This snippet must be placed in an EGL JSF Handler part. This snippet has the following prerequisites:
  1. The JSP page has a data table.
  2. The names of the JSP identifiers have not been changed from the default.
  3. The page is defined as request in scope in faces-config.xml, not session.
To insert and configure this snippet, follow these directions:
  1. In a JSF Handler, define a character or string variable to receive the clicked value.
  2. Place the cursor on a blank line in the JSF Handler where it is legal to add a function. (This snippet includes an entire EGL function.)
  3. In the EGL drawer of the Snippets view, double-click the Get clicked row value snippet. The Insert Template window opens. For more information, see Inserting EGL code snippets.
  4. In the Insert Template window, type the name of the variable as the value of the receivingVar variable.
  5. Click Insert.
  6. From the Enhanced Faces Components drawer in the Palette view, add a command hyperlink to a field in the data table.
  7. For the target of the command hyperlink, specify the name of the JSP page. The hyperlink links to its own page.
  8. Add a parameter to the hyperlink and give that parameter the same name as the variable in the JSF Handler that receives the clicked value.
  9. On the All tab of the Properties view, set the action property to the getVal() function.
The code that is inserted by this snippet follows:
function getVal()
	javaLib.store((objId)"context", 
   "javax.faces.context.FacesContext",
   "getCurrentInstance");
	javaLib.store((objId)"root", 
   (objId)"context", "getViewRoot");
	javaLib.store((objId)"parm", 
   (objId)"root", 
   "findComponent",
   "form1:table1:param1");
	recVar = javaLib.invoke((objId)"parm", 
                          "getValue");
end

Feedback