JSP Rendering Tab

This tab determines how the field will look when compiled into JSP code when viewed in a web browser.

The JSP Rendering Code is Java code that takes in as arguments the session variable for the instance of the Custom Field Type, the field identifier, the display only indicator, the HttpServletRequest, and the HttpServletResponse. This is an example of code that might be entered in the JSP Rendering tab.

String CFTRR_My_New_Type(String sess_var, String field_identifier, int disp_only, HttpServletRequest request, HttpServletResponse response, int)

{

        String html;

if (disp_only == 0)

{

html = "<input name='" + field_identifier + "val1'";

html = html + " size=" + getProp(field_identifier, "size", request, response);

html = html + " value='" + sess_var + "'>";

}

else

html = sess_var;

return html;

}

This function creates an <input> tag containing the name, size, and value attributes.

Properties defined in the Properties tab can be assigned to attributes in a tag in the JSP Rendering code. To do this, the property is referenced by the getProp() function call, as seen by the size attribute and its assigned property above in the example code.