on 02-06-2006 11:07 PM
hi everybody,
i want to put the maxlength attribute in a inputfield control, but i don´t see the property in the attribute window for this control.
Somebody knows.. how to do it or only this type of validation are by code?
thks
Josué
Message was edited by: Josue Cruz
Message was edited by: Josue Cruz
Hi,
In webdynpro explorer open the project structure. in dictionary->local dictionary->simpletypes
right click and create a simple type. You can set the various parameters like minimum length ,maximum length, basic type etc. if you en you create an attribute give the property type as the simple type you created
the validations will be done when you perform an action in the view
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Following your instruction on changing the type: my view context is map to a web services object and Web Dynpro would not allow me to change the type. Any thought?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Christian,
Then this is typical case for calculated attributes.
Say, you have model node MyWs_Request with model attribute MyParam of type string. You want to limit number of characters for MyParam attribute.
Create 1..1 non-singleton value sub-node MyWs_Request_Proxy as direct child of MyWs_Request node. In this node create attribute MyParam_Proxy with your custom simple type defined in Local Dictionary (sure, this custom type must have MaxLength restriction set). Make this attribute calculated and NW IDE will generate getter/setter methods. Fill in the following:
in getter:
final IWDNodeElement real = element.node().getParentElement();
return (String)real.getAttributeValue("MyParam");
in setter:
final IWDNodeElement real = element.node().getParentElement();
real.setAttributeValue("MyParam", value);
Now bind any InputFields to calculated proxy attribute. MaxLength restriction will be applied.
Valery Silaev
SaM Solutions
Josue,
To have the length limited in the browser you need to setup a simple type and set its maximum length to what you want. Then on the context attribute you have bound your input field to, set the type to the simple type you setup. When the html is generated it will include a maxlength tag for that input field and the browser will limit the entry to that number of characters.
Cindy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
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.