on 07-11-2007 11:36 PM
Hello,
I am on EP7.0 ERP05 and NW04s and trying to add values to a dropdownbyIndex at runtime using the following code:
String[] exempt_status= new String[] {"Exempt,reportable","Not Exempt"
};
List ListOfExempts = new ArrayList();
for(int i=0;i<exempt_status.length;i++)
{
IPrivateDetailView.IExemptNodeElement ex=wdContext.createExemptNodeElement();
ex.setExemptAttribute(exempt_status<i>);
ListOfExempts.add(ex);
}
wdContext.nodeExemptNode().bind(ListOfExempts);
for (int e = 0; e < wdContext.nodeExemptNode().size(); ++e)
{
wdContext.nodeExemptNode().setSelected(e, e>=0 && e<=1 );
}
wdContext.nodeExemptNode().setLeadSelection(1);
//@@end
}
This creates a dropdown fine with default value as "Not Exempt" but also inserts a blank value after that and then the other 2 and when the user selects this blank value it results in a Null pointer exception ... when I debug and check if it's null it says "Attribute value passed to non-object value"
How can I rectify this by removing the blank option altogether...
Any help would be highly appreciated,.
Hello,
Thanks for the reply. I changed the cardinality to 1..n still it didn't help/
Please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If your DDBI node cardinality is 0..n then the DDBI will have a Empty
element at the start else if cardinality 1..n then their is no blank element in DDBI.
String[] exempt_status= new String[] {"Exempt,reportable","Not Exempt"};
for(int i=0;i<exempt_status.length;i++)
{
IPrivateDetailView.IExemptNodeElement ex=wdContext.createExemptNodeElement();
ex.setExemptAttribute(exempt_status);
wdContext.nodeExemptNode.addElement(ex);
}
wdContext.nodeExemptNode().setLeadSelection(1);
//@@end
}
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys for your help. I modified the selection of the node to 1...n and it worked ..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sriram,
Thanks for the reply. I tried to change the cardinality to 1...n but still it didn't help , even if it has a blank value how do we handle it because when we select it it results in a null pointer exception....
Looking forward to your reply.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Subhash,
DDIndex always display one blank entry. Use DDKey instead
Create a context variable (not inside a node) and bind it to value of DDKey.
Let the variable name be DDVal.
To put the values to DDKey, try the following code
IWDAttributeInfo approverInfo=wdContext.getNodeInfo().getAttribute(IPrivate<View>.IContxetElement.DDVAL);
ISimpleTypeModifiable stf=approverInfo.getModifiableSimpleType();
IModifiableSimpleValueSet svs=stf.getSVServices().getModifiableSimpleValueSet();
for(int i=0;i<masterNode.size()i++)
{
String key=masterEl.get<Key>().toString();
String value=masterEl.get<KeyValue>().toString();
svs.put(key,value);
}
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Change the cardinality of the node from 0..n to 1..n.
Regards
Ayyapparaj
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.