on 03-28-2007 11:00 AM
Hi Guru's!
I have a question regarding the type Time.
I have a table in my application which is bound to a ModelNode (rfc)
the Time Attribute is bound to my table editor of type (TextView), and the representation is: hh:mm:ss fx(12:00:00).
Is it possible to remove the seconds in an easy way?
Help is apreciated.
Br
Ronni
Ronni,
For value node try add the following to wdDoInit of controller where attribute defined (i.e. if it's defined in component controller and mapped in view controller then place code to component controller; if it's defined in view -- then in view controller):
final ISimpleTypeModifiable mtype = wdConext
.node<YourNode>
.getNodeInfo()
.getAttribute("YourTimeAttr")
.getModifiableSimpleType();
mtype.setFormat("HH:mm");
Unfortunately, this doesn't work for model attributes. As a workaround:
1. Create 1..1 non-singleton value sub-node, selection 1..1, initializeLeadSelection=true
2. Add attribute TimeFormatted of type time, mark this attribute as calculated
3. In generated getter/setter just return/apply value from/to corresponding attribute of parent element:
<getter> --
return (Time)element.node().parentElement().getAttribute("YourTimeAttr");
<setter> --
element.node().parentElement().setAttribute("YourTimeAttr", value);
4. Apply format to calculated attribute (as described in the beginning of this post.
5. Bind TextView in table to calculated attribute.
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 |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.