on 2009 Jan 27 7:09 PM
Hi..
I need to know how to do a while in web dynpro.
I have one node (is a table, cardinality 0..n), with many parameters inside.
I need to navigade, with a while, between this records...
something like:
int intTotal = wdContext.currentDataElement().otherContextElement().getSize() //or something like this...
while(int x=0; x<intTotal; x++){
System.out.println("...asoiajdofjasd");
}
How to do this?!
Thanx!
Mixing the answers, I can do this...
Thank's!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if u have the following context structure,
value node :L1
L1 has a value node :L2.
L2 has a value attributes a1,a2.
to get the size of L2.
wdContext.nodeL2().size(); is possible.
We need not use L1 to navigate to L2.
for (int i = 0; i < wdContext.nodeL2().size(); ++i)
{
wdContext.nodeL2().getElementAt(i);
}
Regards
Alamelu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean how to iterate over all elements inside a context node? I think this should be obvious by reading the API Javadoc.
for (int i = 0; i < wdContext.nodeXYZ().size(); ++i)
{
IXYZElement e = wdContext.nodeXYZ().getXYZElementAt(i);
/* do something with node element */
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So...
And to access a subnode?!
For example:
wdContext.nodeXYZ().otherSubNode().otherSubSubnode().size
I can't find this methods inside my context...
My context is something like this:
-nodeXYZ
--contextSub
---contextSubSub
-
Field01
-
Field02
-
Field(...)
I need to capture this fields...
Thank's a lot...
😃
That depends. If you have the following structure
XYZ (node)
-- Child (node, singleton=false)
---- text (string)
then you can iterate like this:
for (int i = 0; i < wdContext.nodeXYZ().size(); ++i)
{
IXYZElement e = wdContext.nodeXYZ().getXYZElementAt(i);
for (int j = 0; j < e.nodeChild().size(); ++j)
{
IChildElement child = e.nodeChild().getChildElementAt(j);
String text = child.getText();
}
}
Armin
You can use the keyword 'for' instead of 'while'.....it will serve the same purpose...
Regards,
Shikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
11 | |
10 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.