on 01-15-2006 4:07 AM
Hi,
How can we catch UIElement in View code and ? how can we change the UI element properties thru code dynamically?
Thanks
Hi ,
In
wdDoModifyView
we have a argument called view.
This attribute gives us access to the view and the UI elements contained in it.
To access a UI element in the view,
view.getElement("the UI element Id you have given").
Typecast this to the requisite UI element. You can then use it to set its properties.
About the question in the other post, description is the UI element name and Activity.Description is the name of the attribute bound to it.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
2 things to note.
1. Is the node initialized.
2. Is there any value set to the data attribute.
Create a attribute directly under the root,set its value in init and bind it to the textview. If this works, there is a problem with your node . Set the node's cardinality as 1..1.
Regards
Bharathwaj
Hi
public void wdDoInit()
{
//@@begin wdDoInit()
String value="";
for(int k=0;k<5;k++)
{
IWDNodeElement element = wdContext.nodeMyNode().createElement();
element.setAttributeValue("data", "NewYork");
wdContext.nodeMyNode().addElement(element);
}
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
for(int i=0;i<5;i++)
{
//wdContext.nodeMyNode().getMyNodeElementAt(i).setData("NewYork");
//msgMgr.reportException("Size: " +wdContext.nodeInput().size(), true);
}
for(int j=0;j<5;j++)
{
//value = wdContext.nodeMyNode().getMyNodeElementAt(j).getData();
msgMgr.reportException("Text: " +value, true);
}
//IWDView view;
//IWDViewElement e;
//e.getView().getElement(TextView1);
//@@end
}
public static void wdDoModifyView(IPrivateArrayView wdThis, IPrivateArrayView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
IWDTextView Text1 = (IWDTextView)view.getElement("TextView1");
Text1.bindText("MyNode.data");
//@@end
}
And the cardinality is 0..n if change it to 0..1 itz giving error...and i guess it wont allow me to create elements under that node
Hi,
You are creating 5 elements. So when u set the cardinality as 0..1 (meaning... o 0r 1 element it will give error.)
The cardinality should be 1..1 (or 0..1).
In case of 0..1 , write the code once..and not within a loop. Also make sure that the "initialize lead selection " property is set to true.
It will work now.
//write this code directly after setting the cardinality as 1:1 and take the loop out
element = wdContext.nodeMyNode().getMyNodeElementAt(0);
element.setAttributeValue("data", "NewYork");
Regards
Bharathwaj
Hi
Itz working, but it doesnt solve my problem can you help me out here.
In my application I have to create Calender for 3 months(current month and coming two months), In this calender I've to create DropDownBox in each cell to display some text with day number..?
Could you tell me how could i create UIElement for this Calender.
Thanks
Hi,
Hmm.. What you are now asking is a different question altogether.
Anyways, make use of DateNavigator UI element for your requirement.
On select of any date you can display the details related to it and populate or make selections in the dropdown accordingly.
http://help.sap.com/saphelp_nw04/helpdata/en/3b/38fd2d7a964645a5417d2a69462ae5/frameset.htm
This link gives a detailed explanation. Please go through it . In case if you have any problems , post a seperate question.
Regards
Bharathwaj
Please check out this tutorial.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.