on 04-11-2018 12:53 PM
Hi Experts.
I am currently dealing with the following problem:
I have a view which provides a Value help on a table which has a UUID as primary key.
And we have a transactional View which consumes the value help. This view has a reference field which is a UUID too.
Because no one will see a UUID on the screen, I would like to hide the UUID on the consuming view AND in the value help. And here is my problem!
I can't find a way to hide the UUID and display the Text with the value help attached.
Text is in the table which is an association to the consuming table and must be read only -> read only field can't have a value help. And even if it would be possible, how can I tell the value help to push the key NOT in the text field?
Does anyone have an idea how I can get rid of the UUID Field on the screen by Fiori Elements annotation?
Thanks a lot in advance
Hello Community,
Fiori elements with UI5 version 1.84, Input fields with value help can now be configured to show texts and ID together in the Edit and Display modes of an object page. For more information, see Displaying Text and ID for Value Help Input Fields. In case there is any open questions you can also follow or ask in the newest thread on this topic here.
Regards,
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
I took advantage of both solutions:
Now my problem is with the smart filter on the list report: I cannot find a way to hide the UUID and show something more human readable. Any ideas?
Thanks in advance
Alessandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bettina
Meanwhile we have used the SmartForm Extension Point to add custom SmartFields with the textInEditMode property set. Alternatively one can also set this property in the onInit method of the ObjectPage Controller by using a Controller Extension and accessing the element by it's id.
Unfortunately this feature has some flaws when the key property is of type Edm.Guid: The field tries to retrieve a text for initial GUIDs and then produces an error message as there are no texts to be found for initial GUIDs. In addition, when initializing the field by removing the text value the key property is cleared in the bound context but the field displays the text value again when it loses the focus - making the user assume that the value has not been cleared.
I issued a call at SAP but their answer was more or less the same as in the other call. SAP says that this feature is experimental and not intended for productive use. I don't know if they really care about that obvious problem. Meanwhile the release 1.70 of SAPUI5 is available (Cloud Version) and still nothing has changed up to now...
If this is not a suitable solution for you, you could also use the SmartForm Extension to place the text value with an icon or button to open a value help dialog so that the user can select the item and then set the key/text values in the corresponding properties of the bound context. Of course this means quite more work to be done.
Hope this helps.
Regards
Gabriel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
About your other question "And even if it would be possible, how can I tell the value help to push the key NOT in the text field?":
Use the additionalBinding of the @Consumption.valueHelpDefinition annotation in your CDS view.
Or if you are using the class generated by the SADL Generation Toolkit of your service to enrich the metadata (e.g. to bind a value help to a function import parameter), you could use the annotation "com.sap.vocabularies.Common.v1.ValueListParameterOut" in your value help binding to bind the key field of the value help to the corresponding property. Something like:
DATA:
lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target,
lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation,
lo_record TYPE REF TO /iwbep/if_mgw_vocan_record,
lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection.
lo_ann_target = vocab_anno_model->create_annotations_target( iv_target = "<Your target>" ).
lo_annotation = lo_ann_target->create_annotation( iv_term = 'com.sap.vocabularies.Common.v1.ValueList' ).
lo_record = lo_annotation->create_record( ).
lo_record->create_property( 'CollectionPath' )->create_simple_value( )->set_string( CONV #( i_valuelist_entityset ) ).
lo_collection = lo_record->create_property( 'Parameters' )->create_collection( ) ##NO_TEXT.
lo_record = lo_collection->create_record( 'com.sap.vocabularies.Common.v1.ValueListParameterOut' ).
lo_record->create_property( 'LocalDataProperty' )->create_simple_value( )->set_property_path( "<Name of localdataproperty>" ).
lo_record->create_property( 'ValueListProperty' )->create_simple_value( )->set_string( "<Name of valuelistproperty>" ).
Regards
Gabriel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
We have the same problem. As the BOPF object model wants single UUIDs as a primary key, it is just a matter of time until the developer runs into this dilemma when the application is a bit more complex than the sales order app SAP usually uses for examples... 🙂
As of release 1.54 of SAPUI5 the SmartField control has a new attribute TextInEditModeSource: SAPUI5 SDK - smartfield.TextInEditModeSource
But unfortunately Fiori Elements does not use this new attribute of the SmartField (by now).
I have issued a call several month ago relating to that problem. Here is an excerpt of the reply i got from SAP:
Please be aware that the feature is still marked as experimental. The reason for that is as follows:
With the current implementation it is cumbersome or even impossible to use the feature in scenarios like Fiori Elements.
To improve the situation we want to introduce some kind of automatic mode, where the feature is enabled as soon as the metadata provide all necessary information.
During the implementation there might be changes to the existing API needed, therefore still the "experimental" flag is set.
As always I unfortunately cannot make any statement about when the enhancement will be available for our customers.
So at the moment i think you have this options:
At the moment we are favoring number two as our project is rather long term and are hoping that SAP will come up with this feature soon... 🙂
I would be very interested in your approach to solve this problem.
Regards
Gabriel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.