KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > datagrid > AbstractDatagridColumnTag


1 package fr.improve.struts.taglib.layout.datagrid;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4
5 import fr.improve.struts.taglib.layout.collection.CollectionInputTag;
6 import fr.improve.struts.taglib.layout.collection.CollectionTag;
7 import fr.improve.struts.taglib.layout.el.EvaluationException;
8 import fr.improve.struts.taglib.layout.util.LayoutUtils;
9
10 public class AbstractDatagridColumnTag extends CollectionInputTag {
11     /**
12      * Build the input field name.
13      * The pattern is : "property attribute of the datagrid tag" . "property of the column tag" [ index ]
14      */

15     protected String JavaDoc buildInputFieldName(CollectionTag in_parent) throws JspException JavaDoc, EvaluationException {
16         StringBuffer JavaDoc lc_fieldNameBuffer = new StringBuffer JavaDoc();
17         lc_fieldNameBuffer.append(in_parent.getProperty());
18         lc_fieldNameBuffer.append(".");
19         lc_fieldNameBuffer.append(property);
20         lc_fieldNameBuffer.append("[");
21         lc_fieldNameBuffer.append(in_parent.getIndex());
22         lc_fieldNameBuffer.append("]");
23         return lc_fieldNameBuffer.toString();
24     }
25     
26     /**
27      * Build the input field value : use the Datagrid object.
28      */

29     protected Object JavaDoc buildInputFieldValue(CollectionTag in_parent, boolean in_anyError) throws JspException JavaDoc {
30         // get the value from the current bean in the collection
31
Object JavaDoc value = LayoutUtils.getProperty(in_parent.getBean(), property);
32         return value;
33     }
34 }
35
Popular Tags