cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <Ralph.Go...@dslextreme.com>
Subject Re: CForms: some renamings on the Widget interface
Date Mon, 13 Jun 2005 18:43:30 GMT
Sylvain Wallez wrote:

> Hi all,
>
> As part of the stabilization work on CForms, there are a couple of 
> changes I'd like to do on the naming-related methods of the Widget 
> interface.
>
> Today we have:
> - getId() which returns the local name of widget.
> - getRequestParameterName() which returns the combination of the 
> parent widgdet's requestParameterName with the local name.
>
> Working with advanced templates and Ajax stuff, I find these names 
> increasingly annoying and confusing:
> - each widget produces an HTML element with an "id" attribute filled 
> with getRequestParameterName(), and not getId()!
> - this getRequestParameterName is really tooooo long to type, 
> especially in templates where we have no IDE autocompletion.
>
> Ideally, I'd like to do the following renaming:
> - getId() --> getName()
> - getRequestParameterName() --> getId()
> But since the meaning of getId() changes, this is likely to cause 
> weird things in existing code.
>
> So I propose the following:
> - getId() --> getName()
> - getRequestParameterName() --> getFullId()

I'm not familiar with this stuff at all, but from your description it 
appears that getFullName() would be better.  You could also use 
getLocalName() instead of getName(), but I like getName() as its shorter.

> - deprecate and remove later getId() and getRequestParameterName().
>
> Once getId() will have been removed for some time, we'll be able to 
> reintroduce it as an equivalent to getFullId().
>
> WDYT?
>
> Sylvain


Ralph


Mime
View raw message