on 11-19-2008 4:12 PM
Hi experts
please help me
Is there a way to dynamically construct code, such as:
I'd like to write a method that receives as input a string identifying a node name, and use it as follows:
wdcontext.current<InputNodeName>Element.get<AttributeName><do whatever I want>
OR
Is there a way to construct a string containing a command, and then execute it?
Such as: If I construct the following in a string by concatenating different parts of the string: wdcontext.current<InputNodeName>Element.get<AtributeName>.<do whatever I want>
Can I then pass the resulting string to some function that actually executes it?
Yes, this is easy, just use the generic context API. See IWDNode, IWDNodeElement, IWDAttributeInfo etc.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Unfortunately - there is no way to construct the command dynamically so that the command will execute. The parameters that are part of teh command may be dynamic (using Super classes and method overloading).
However, in case you want to write a single method that does all the function calling then what you need to do is:
1.) Make a context attribute that will hold some code (1,2,3 or A,B,C etc)
2.) Create the method that will read this attribute.
3.) After reading the attribute write a switch case or an if statement that will run your command.
Of course for this you will need to know all the required commands at design time.
Thanks.
p256960
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this:
wdContext.getChildNode(<nodename>,IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("attributename")
Now you can perform the operation that you want to on this attribute.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for example
I want use parameter
String par="NodeName"
in statement - wdcontex.currentparElement.get...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I understood that you wanted to do evaluation some thing and then pass that value to the function.
In this case you can take a label or InputField with invisible property and correspondingly take context attribute.
Do the manipulation what ever you want and set the value to InputField. Latter where ever you want you can access from the context.
Regards,
Lakshmi Prasad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.