on 05-15-2007 6:06 AM
Hello all,
I am displaying n number of field and labels dynamically.
I need to restrict the field length, for which I need to create dynamic simple types.
Can any one help me in creating Dynamic simple types, set datatype and maxlength, assign this to the field's context attribute.
And, I am creating value help for the input fields, when I click on value help of integer field it is giving an error. Is it that value help for string values only.
If so do I need to use caliculated attribute for integers.
Thanks in advance,
sai.k.k
Thanks for all your replies ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
To create simple types dynamically.. use this code
IWDAttributeInfo name1info = wdContext.nodeTest().getNodeInfo().getAttribute("Name1");
ISimpleTypeModifiable name1 = name1info.getModifiableSimpleType();
IModifiableSimpleValueSet name1ValueSet = name1.getSVServices().getModifiableSimpleValueSet();
name1ValueSet.put(key u want to add, corresponding value u want to add);
Name1 is a value attribute inside Test node().
U just hv 2 bind this context to a UI element.
For more info read this
http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/a018b505747b47a22cd7d2e446df88/frameset.htm
Do reward points if helpful!
Thanks
Puneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sai.k.k.
I believe, you do create 'N' context attributes as you have mentioned that UI is dynamic. If so, I would suggest that you do manipulate the simpletype at the attribute level itself. A simple example would be like this.
wdContext.node<nodeName>().getNodeInfo().getAttribute("<attributeName>").getModifiableSimpleType().setFieldLabel("<Name>");
wdContext.node<nodeName>().getNodeInfo().getAttribute("<attributeName>").getModifiableSimpleType().setMaxLength(12);
wdContext.node<nodeName>().getNodeInfo().getAttribute("<attributeName>").getModifiableSimpleType().setMinLength(3);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ramesh ,
Yes I am creating context attributes dynamically.
As you said, I added the following code:
<b>
IWDAttributeInfo Ainfo = wdContext.nodeMaterial_Create().getNodeInfo().getAttribute(resourceHandler.getString("FIELD"i"_FIELDNAME"));
Ainfo.getModifiableSimpleType().setMaxLength(5); </b>
or
<b> wdContext.nodeMaterial_Create().getNodeInfo().getAttribute(resourceHandler.getString("FIELD"i"_FIELDNAME")).getModifiableSimpleType().setMaxLength(25); </b>
both of them giving an error as :
java.lang.IllegalArgumentException
at com.sap.dictionary.runtime.DdSimpleType.setMaxLength(DdSimpleType.java:714)
at com.sap.tc.webdynpro.progmodel.context.ModifiableSimpleType.setMaxLength(ModifiableSimpleType.java:224)
Where am I doing wrong.
Konchada,
Probably the reason is that you try to apply max. length constraint to non-string data type (numeric or date)
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.