writeable attributes of formcontrols / httpelements?

"Wolfgang Fahl" <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
Dear httpunit community members,

Patch [ 1393367 ] Patch for writable form.name 
javascript attribute

The patch at:
https://sourceforge.net/tracker/index.php?func=detail&aid=1393367&group_id=6550&atid=306550


suggest to make the attribute "name" writable like this:
46a47
>     private       String  _nameAttribute;
81a83
>         _nameAttribute  = "";
97a100
>         _nameAttribute  = NodeUtils.getNodeAttribute( node, "name" );
295a299,302
>     
>     public String getName() {
>         return _nameAttribute;
>     }
388c395,399
<             } else if (propertyName.equalsIgnoreCase( "disabled" )) {
---
>             }
>             else if (propertyName.equalsIgnoreCase( "name" )) {
>                 _nameAttribute = value.toString();
>             }
>             else if (propertyName.equalsIgnoreCase( "disabled" )) {


In principle each attribute could be made "writeable" if 
this would be implemented in HTMLElementBase.java by 
introducing a "cache" for:

    /**
     * get the Attribute with the given name - by delegating to
     * NodeUtils
     * @param name - the name of the attribute to get
     * @return the attribute
     */
    public String getAttribute( final String name ) {
        return NodeUtils.getNodeAttribute( getNode(), name );
    }


So first we'd lookup the attribute in the cache and only 
if it is not in there we'll go to the Nodes themselves.

What else would be necessary here? 

Wolfgang

BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 1805 - BITPLAN / +49 1805 248 752, Fax +49 2154 811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548, 
Geschäftsführer: Wolfgang Fahl

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.