on 08-08-2007 5:27 PM
How to change the inbuild date datatype format?
Hi
Follow the code below:
// Setting the Date in Indian format dd/mm/yyyy - in the wdInit() of the component controller
IWDAttributeInfo attribinfo = wdContext.getNodeInfo().getChild("Z_Bapi_XXXX").getChild("XXXX").getAttribute("XXXX");
ISimpleTypeModifiable simpleTypeModifiable = attribinfo.getModifiableSimpleType();
simpleTypeModifiable.setFormat("dd/MM/yyyy");
where XXX is the BAPI name and other XXX are the child attributes.
Cheers!!!
Sukanta Rudra
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
In that case > access the child attribute
IWDAttributeInfo attribinfo = wdContext.getNodeInfo().getChild("<node_name>").getNodeInfo().getChild("<inner_node>").getChild("XXXX").getAttribute("XXXX");
ISimpleTypeModifiable simpleTypeModifiable = attribinfo.getModifiableSimpleType();
simpleTypeModifiable.setFormat("dd/MM/yyyy");
Hopefully this gives u an answer
Thanks
Srikant
Hi Renuka,
Follow these steps:
1. Create a context attribute named date1
2. create a simple type (local Dictionary-->simpletype) named date1 of type date.
3. If you want your date format to be same always and doesn't require to change dynamically then go to representation tab for your simple type (date1) and set its format to dd/MM/yyyy(eg.)
4. For your context date1 set it type property to your simple type(using browse button ...)
5. Bind this context to a input field in your view
If you want to change the format of your date at runtime then you need to write this code in the method where you would like to change its format.
IWDAttributeInfo attr = wdContext.getNodeInfo().getAttribute("date1");
ISimpleTypeModifiable simple = attr.getModifiableSimpleType();
simple.setFormat("dd/MM/yyyy");
Regards,
Murtuza
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.