How to get the value of property,where the property name is stored in another parameter
I need to get/set the value of/to a property in a page,where property name is stored in another parameter.
For instance ,let consider the name of the property as "XX".It is stored in the local parameter PropertyName.
How can i set any value to this property / get value from this property ?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
If you are doing this in an Activity and don't mind using Java Steps; you can use code like this:
- String PropertyName=tools.getParamValue("PropertyName");
- String PropertyValue=tools.getParamValue("PropertyValue");
- myStepPage.putString( PropertyName, PropertyValue );
I have a set of properties including 'title' and 'city' here; and using different parameters to my Activity the code above will set the appropriate property:
Here's the Parameter Tab for my Activity:
And the Steps - just a Page-New , the Java Steps (the code already pasted above), and a Show-Page:
For completeness here's the Pages & Classes tab, change this for your class structure of course:
And when I run this with the Parameter set to 'Title' :
The Show-Page confirms the '.Title' property is set:
If I run it again with 'PropertyName' set to 'City', it changes to this:
TIP: It is informative to use the 'Show Java' option on the 'Actions' Button on the Activity Screen in the Designer Studio - I used this to remind myself how to get at the API needed to fetch stuff from the parameters page for instance : just create a standard 'Property-Set' step which references 'Param.yourparam' , save the Activity and then 'View Java'.
Also: The Engine Java API is available from the Designer Studio from the Resources > Engine API menu. (on 721, other versions have a 'help' menu).
Useful Engine Classes to look at to start with:
PublicAPI (this is what 'tools' is an instance of, in automatic code)
ClipboardPage (this is what 'myStepPage' is an instance of , in automatic code).
Hope this helps,
Keep up to date on this post and subscribe to comments
- we have a Page property and I am referring it to a Data page which have two parameters.This Page is storing all the latest account status which is coming from service.
- Stored Procedure parameters (blank property)
- Declare_UIGalleryControls.pyTextArea1---What kind of property is this,where its defined
- Call Stored Procedure with an OUT Parameter
- How to pass Value List as input parameter to an Oracle Stored procedure