cancel
Showing results for 
Search instead for 
Did you mean: 

Change look of Time Type

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Valery!

it is a model node, so i will try you solution with the 1:1 node.

Thanks for your quick reply!

Best regards

Ronni Hostrup

Answers (0)