Adding JavaScript event attribute support to display:column

网上找来的篇E文,有空仔细看一下。
I am attempting to extend the DisplayTag 1.0 library to include support for JavaScript event attributes (e.g. onmouseover, onclick, etc/) to the display:column tag.

However, I have hit something of a road block. After modifying the TLD, ColumnTag.java and ColumnTagBeanInfo.java, I continue to receive an error "Cannot find setter for attribute [x]". What am I missing? What else needs to be changed?

Here are examples of the changes I have made so far:

In displaytag-12.tld, in the declarations for the column tag, I've added attribute definitions like the following:

<attribute>
            <name>onmouseover</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
            <type>java.lang.String</type>
            <description>
                JavaScript onmouseover event attribute.
            </description>
        </attribute>

In ColumnTag.java I've included setter methods for the various attributed, like the following:

    /**
     * setter for the "onmouseover" tag attribute.
     * @param value attribute value
     */
    public void setOnmouseover(String value)
    {
        this.attributeMap.put(TagConstants.ATTRIBUTE_ONMOUSEOVER, value);
    }

Finally, in the ColumnTagBeanInfo.java, I've included property descriptors, like the following:

    proplist.add(new PropertyDescriptor("onmouseover", //$NON-NLS-1$
ColumnTag.class, null, "setOnmouseover")); //$NON-NLS-1$

Yet, I still get the setter not found exception when I try to use
    
     <display:column property="clientName" title="Company" sortable="true" headerClass="t4 tableHeader" class="t5 tableCell" onmouseover="someFunc()" />

Any help would be greatly appreciated!

你可能感兴趣的:(JavaScript,java)