Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)
In Progress

Generic formatter option

Im stumbling across more and more places where I want to make use of a formatter function, e.g. the Button element (for properties Visible, Enabled, ...).

Instead of requesting the formatter for each property ...

Why not make the formatter option generic, to give developers the possibility to implement it wherever wanted.




Got my mapper methods in place (for other cases as well).

I'm thinking about it, will share my solution later, maybe they spark something.

The part of automatic and generic true/false from space/x is not straight forward. 


All fields in the JSON data must be checked against all possible places it is used in the binding, and then convert it - depending on field type and field property. 


Recommend making a generic mapper in your application class, but will check if we can find another way for it.



Whats the plan for this formatter option? Will it really handle all fields (generically)?


I'm in need for a "automatic" conversion of abap_false/abap_true values to "false"/"true" strings.

Preferrably not only for output formatting, but also for value updating.

Nice to hear about updates.

You'll get it to work, I know that :)

Tested on visible/editable/enabled properties, and it will not update the UI object after changing the value true/false. 


Working on it.

We also like the formatter more and more and see the need of implementing it into more properties. Was planning to see if we can implement the formatter on almost every property. Not all are relevant.


In javascript it is possible to implement a formatter for all possible properties, but it requires some JS coding - the syntax is:


selItem.bindProperty("info",{parts:["SEQNR"],formatter:function(SEQNR){

if (typeof(SEQNR) == 'undefined') { return; }

if (SEQNR== null) { return; }

var formattedText = SEQNR + ' Demo');

return formattedText;

}});


In support package 3 we will add several more Formatters, like visible, enabled, editable etc.



Login or Signup to post a comment