Reinhard Poetz wrote:
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()
- 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().
+1
In order to be consistent (and as already proposed from somebody else
we change from <fd:widget id="foo"/> to <fd:widget name="foo"/>, right?
Yes. And as proposed by Ralph, that will be the better-looking
getFullName() instead of getFullId().
Sylvain
--
Sylvain Wallez Anyware Technologies
http://apache.org/~sylvain http://anyware-tech.com
Apache Software Foundation Member Research & Technology Director