on 05-12-2005 4:34 PM
Noufal,
I am working on a WD app wherein I need to dynamically populate dropdownlists, input fields. Dynamic values are contained in an object that has propertiy values such as id, text (could be a value set), read-only flag, labelid flag etc.....
My issue is depending on the UI element type (dropdownlsit, input field, checkbox etc..) I may have to populate UI element corresponingly. I do not want to yse context nodes to bind values, as I have way too many fields to populate. My question to you is as follows:
1) How do I know the type of the element ?
2) How do I populate the dropdown list ?
3) Show the view manipulation be done only in the wdDoModifyView method only ?
If you have posted code for some of my questions, please paste in your response once again....
Thanks,
Sri
Can you please give some more details?
Are the UI elements statically defined or do you want to create them programmatically from some configuration data?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you are right. I want to populate a view programatically from data in the context. The data for the view, is based on the UI elements in the view. So, in order to get the list of UI elements (of interest to me), I need their element ID's. This I plan to store as values attributes. Rather than traversing the UI element hierarchy and pick'n choose elements I want, I use the approach of storing their Id's as values attributes.
Do let me know if you see any major pit-falls in my approach.
Thanks !
Sri
Armin,
"The data for the view is based on the UI elements in the view" should read as "the data required for populating the UI elements is obtained from buisness rule objects"
Use case: Creating a Material Master Data maintanence app. Business rule for each material master field, have been represented as an XML shema. At runtime rule profile objects are created that supply data to populate in the UI elements.
Also, if possible, please advise the best way to traverse a node consisting of values nodes, and get the value for each attribute in the value node.
Example:
NodeA
--NodeA1
--Node11
--Value1
--NodeA2
--Node21
--Value1
--NodeA3
--Node31
--Value1
Need to be able to read 'Value1' for each node.
Thanks in advance !
Sri
wdcontext.nodenode11element.getelementat(index).getValue1();
wdcontext.nodenode21element.getelementat(index).getValue1();
and so on
Hope you have all the attributes created statically.
If they are being created dynamically
wdcontext.nodenode11element.getelementat(index).getattribute(String);
Hope that helps
Message was edited by: Noufal Kareem
Armin,
I reviewed the chapter and found it helpful. However, I am not sure if it addresses the issue of accessing the value of a node, the kind I have talked about. Example is as follows.
I have the context structure created dynamically, and it is as follows.
NodeA
-
NodeA1
-
NodeA11
-
Element1
-
Element2
-
Element3
-
NodeA2
-
NodeA21
-
Element1
-
Element2
-
Element3
-
NodeA3
-
NodeA31
-
Element1
-
Element2
-
Element3
One of the earlier responses to my post, I think it was by Noufal, would work if nodes were created at design time.
But noes above are created at runtime.
I have been able to access the node say NodeA11, but still not sure how to access the attribute Element1 or Element2, which ever is the selected element. Keep in mind, these elements are created dynamically, so I cannot access values with statement like
wdContext.currentNodeA11Element().getElement1();
Hope I am making sense. Do let me know how.
Thanks !
Sri
Hi srikanth ,
1, For getting the type of the element use the generic UI element object.getClass()
IWDUIElement a[] = t.getChildren();
for(int i =0;i<a.length;i++){
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(a<i>.getId());
IWDUIElement i1 = (IWDUIElement)view.getElement(a<i>.getId());
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+i1.getClass());
}
2. To populate a drop downlist
ISimpleTypeModifiable stmObj =(ISimpleTypeModifiable)wdThis.wdGetAPI().getContext().getModifiableTypeOf(<"attr name which is mapped to drop down">);
IModifiableSimpleValueSet valueSet =(IModifiableSimpleValueSet) stmObj.getSVServices().getModifiableSimpleValueSet();
valueSet.put(id1,id1);
3.Yes ,anything and everything related to UI element properties should be accessed and modified only in wdDoModifyView
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.