adgreen
Posts: 27
|
Posted: 10/15/2007, 4:55 AM |
|
It would be a very useful feature if in ALL languages each Component from Page down exposed a controls collection with which we could enumerate over all the children and inspect them for their attributes (such as type), then manipulate them (or their parent).
This would allow much more flexible and re-usable code to be created. I do know that is possible to do this in most of the languages supported, but it would way better if it was a formal part of the "API", and therefore our code is not going to break when the underlying implementation changes. (Otherwise it's a hack.)
Perhaps this could be done by making universal the JSP methods across all languages. I don't know.
EG:
getChild Specify a name to find a child control among the collection of children controls.
getChildren Return all children controls of a collection.
getControl Specify a name to find a Control among the collection of controls.
getParent Get the parent component that contains the form.
[also need something like]
getComponentType Get the Type of object such as "Textbox", Record" etc
These (and perhaps others) would be exposed by all controls in each language. With this we can write truly generic code and traverse up and down the page at will. The possibilities are really extended...
Yes?
|