on 05-09-2007 4:58 AM
Hi All,
I have a scenario that involves accessing the ui controls that are dynamically generated. I access them through there IDs.But, I would rather prefer to access them alteratively like through there type which would add on the reusability of the code.Is there a work around in webdynpro that can enumerate all the ui elements of a particular view.
Regards
Amit
If you really need to iterate through the complete UI tree of a view in a generic fashion, you can use the method described in Chris Whealys book "Inside Web Dynpro for Java", chapter 8.3.2.
If it is sufficient to iterate through the children of some containers whose IDs are known, you can use
IWDUIElementContainer container = (IWDUIElementContainer) view.getElement("ID");
for (Iterator children = container.iterateChildren(); children.hasNext(); )
{
IWDUIElement child = (IWDUIElement) children.next();
/* do something with child */
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If its not a nested hierarchy ,
using a getChildren() on the container would do..
IWDTransparentContainer tc = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDUIElementContainer[] uilist = tc.getChildren();
But nested ones are more complicated..Would this suffice your requirement ?
Whats the actual requirement you are looking at.. ?
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amit,
I dont think there is any work around for accessing UI element. As far as I know ids only are used for accessing them.
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.