on 04-16-2007 7:46 PM
Hi All,
In my view I have some InputFields and DropdownbyIndex UI elements.
I binded Value Atrributes for InputFields and Value Node for DropdownbyIndex.
While doing validation for these elements :
For <b>InputFields(Value Atrributes):</b>
IWDAttributeInfo attributeInfo=this.wdContext.getNodeInfo().getAttribute("name");
messageManager.reportContextAttributeMessage(this.wdContext.currentContextElement(),attributeInfo,IMessageSomeComp.MISSING_NAME,
new Object[] { "Name" }, false);
For <b>DropdownByIndex(Value Node):</b>
IWDAttributeInfo attributeInfo1=this.wdContext.nodeSample().getNodeInfo().getAttribute("value");
messageManager.reportContextAttributeMessage(this.wdContext.currentSampleElement()attributeInfo1,IMessageSomeComp.MISSING_NAME,
new Object[] { "Name" }, false);
If I execute this both are working fine and I am getting a Red Box around inputfield(Name). But for DropdownbyIndex it is not like that. There is no Red Box.
why it is like this and how can I solve this. Please give me some good solution.
Thanks a lot in advance.
Joe
Hi,
So, you have to bind Value Attributes to DropdownbyIndex, this is the point!
Use IModifiableSimpleValueSet to populate the DropdownbyIndex.
Regards,
Luciano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sreekanth,
1 - Use any value attribute to bind with the dropdowbyindex value otherwise than value node, with this the red box will work fine.
2 - When you use value attribute to bind with the dropdowbyindex you have to use IModifiableSimpleValueSet to modify the attibute type. This attribute type will be changed to a List type. To do this, you have to read the all values at context node e put these values at this collection.
Something like that:
IModifiableSimpleValueSet valueSet = wdThis.wdGetController().wdGetContext().getContext().getModifiableTypeOf("Zhr_Set_Input.Record.Zstate").getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
for (int i = 0; i < wdContext.nodeI_T005U().size(); i++){
valueSet.put(
wdContext.nodeI_T005U().getI_T005UElementAt(i).getBland(),
wdContext.nodeI_T005U().getI_T005UElementAt(i).getBezei());
}
This code is to fill a State DropDowByIndex.
Regards,
Luciano
Hi Luicano,
Can you help me on how to bind context attribute dynamically to DropDownByIndex.
do i need to create context attribute at run time too, If yes, how can i do this.
i have created the same with DropdownByKey as mentioned below.
IWDDropDownByKey nameDrop = (IWDDropDownByKey) view.createElement(IWDDropDownByKey.class,"txt"+id);
String dropdownValue = aaa,bbb,ccc,ddd;
IWDNodeInfo ddlNode= wdContext.getNodeInfo().addChild("DynamicDDLNode"+id,null,true,true,true,false,false,true,null,null,null);
IWDAttributeInfo info = ddlNode.addAttribute("ddlKey" , "ddic:com.sap.dictionary.string");
ISimpleTypeModifiable myType= info.getModifiableSimpleType();
IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
String[] temp = dropdownValue.split(",");
for(int i=0; i<temp.length;i++){
values.put(new String(temp[i]),temp[i]);
}
nameDrop.bindSelectedKey("DynamicDDLNode"+id+".ddlKey");
Please help as this is really urgent for me to resolve the issue.
Thanks,
Abhishek
Hi Sreekanth,
You need to bind value attribute (which is under node Sample) to dropdownbyindex similar to what u did to inputfield and not value node.
Thanks.
Best Regards,
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why didn't you select a default value and you avoid this validation¿
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 | |
24 | |
11 | |
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.