on 03-29-2006 11:47 AM
hi, all
this is very common problum which every one face. The problum is that how one can handle UI elements(Radio,Label,Input field ) property dynamically.
Bind the properties to context attributes and set the attribute values.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jitender,
i think ur problem is to change the properties of UI elements dynamically, if this is the case...
create the context value attribute of type which ever u want to set for the property... for example if u want to set enable property, u have to create a boolean value attribute...
then bind that value attribute to corresponding UI property...
then u can access that in the code as
wdContext.currentContextElement().set<name of the value Attribute("<ur value>");
hope this helps u
regards
sunil
Hi Jitendra,
Create a node with attributes which will be bound to the property elements of your UI element, also take care of the type of attribute while creating it. At some places you will need "boolean" and at some you will need "string".
Now for the sale of eg. consider you want to disable a input field named "ABC" on click of a button say "click". Follow the steps to achieve same:
1) Create a node, not necessarily though.
2) create a attribute ABC_ENABLE of type boolean, depending on your requirement you can assign it default property of X,for enable, or '', for disable.
3) bind it to Enable property of CLICK button
4) now use method set_attribute () inside action handler OnActionClick() to set the property to true or false and the behaviour will be reflected there at the UI element.
Hope this helps.
Regards,
Anoop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitender
The properties of these UI elements is handled in WDModifyView Method.
example: Accessing the Input Fields
the code looks like this.
IWDInputField input =(IWDInputField)view.getElement("<name of id>");
input.setEnabled(true);
// and other values..
I hope this helps you
Thanks
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai,
create UIElements dynamicaly is possible in wdModify method only.
like this
public static void wdDoModifyView(IPrivateDynamicAppView wdThis, IPrivateDynamicAppView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(wdContext.currentContextElement().getBoolfor()){
IWDTransparentContainer tcont1 = (IWDTransparentContainer)view.getElement("TransparentContainer1");
IWDGridLayout k=(IWDGridLayout)tcont1.getLayout();
k.setColCount(1);
IWDLabel lo=(IWDLabel)view.createElement
lo.setDesign(WDLabelDesign.LIGHT);
wdContext.currentContextElement().setBoolfor(false);
//@@end
}
here boolfor is the context attribute of type boolean. you can set it true in whch action do u want to invoke the cod in wdmodifyview.
all the best.
regards,
naga raju
Hi Jitender,
In WDModifyView() u can handle the properties of the view elements ........
get the reference of the UI elements and then u can manipulate the propeties of that....see the below link
Link to document....
Regards,
yash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.