Understanding "Show" Actions
Whenever you add a subview, a Show action is automatically created. The Show action displays in the Action Bar so that users can display the related subview. Show actions are not smart actions and you don't need to manually create them. The only change you might want to make for Show actions is the label. Each Show action string is hard-coded but you can change it to a string that can be translated.
What's a Show Action?
Show actions are similar to smart actions because they are both available from the Action Bar. However, Show actions are not smart actions. Instead, Show actions are actions that are automatically displayed specifically so that users can navigate to subviews for various objects.
For example, these Show actions were automatically created when you added subviews for the below objects:
Show Action Labels
The labels for Show actions are derived from each subview's display property. The display property was specified when the section was initially added for the subview. You can view subview display properties on the detail page's JSON.
Since Show action labels are automatically derived from the display property strings, the labels are hard-coded and not translatable. If needed, you can make them translatable.
Create a Translatable String
Let's look at an example. If you add a subview for a mashup that displays Wikipedia, then the Show Wikipedia action is automatically created without any action required on your part.
But, maybe you have users who need to see the Show Wikipedia string in Korean. In that case, you can change the hard-coded string to a string that's translatable.
To create translatable Show actions:
-
Add the translatable string to your custom translation bundle.
-
Create a constant that refers to the string in your translation bundle.
-
On the payment_c-detail tab, click the Variables subtab.
-
Click + Variable.
-
In the Create Variable dialog, make sure the Constant option is selected and, in the ID field, enter
subviewLabel
. -
In the Type field, select Object.
-
Click Create.
-
On the Properties pane for the new subviewLabel constant, in the Default Value field, enter the reference to the string that you added to the translation bundle.
Use the following format, where the first
Wikipedia
instance is the subview's display property and the secondwikipedia
instance is the string key that you added to the translation bundle:{"Wikipedia":"[[ $translations.CustomBundle.wikipedia() ]]"}
Be sure to replace the translation bundle name and string with your own information, as needed.
If you have multiple subviews and you need translatable Show actions for each one, then you can add that to the default value for the subviewLabel constant. For example:
{ "PaymentContactMMInter_Src_Payment_cToPaymentContactMMInter_c_Tgt":"[[ $translations.CustomBundle.Contacts() ]]", "Wikipedia":"[[ $translations.CustomBundle.wikipedia() ]]" }
-
-
Add the new subviewLabel constant to the payment_c-detail page's cx-detail fragment code.
-
On the payment_c-detail tab, click the Page Designer subtab.
Click the Code button.
-
Add the subviewLabel constant to the "actionBar" parameter in the fragment code, as follows:
"subviewLabelExtension": $page.constants.subviewLabel
The fragment code should look like the below sample. Be sure to replace
Payment_c
with your custom object's REST API name.<oj-vb-fragment bridge="[[vbBridge]]" name="oracle_cx_fragmentsUI:cx-detail" class="oj-flex-item oj-sm-12 oj-md-12"> <oj-vb-fragment-param name="resources" value="[[ {'Payment_c' : {'puid': $variables.id, 'id': $variables.id, 'endpoint': $application.constants.serviceConnection }} ]]"></oj-vb-fragment-param> <oj-vb-fragment-param name="header" value="[[ {'resource': $flow.constants.objectName, 'extensionId': $application.constants.extensionId } ]]"></oj-vb-fragment-param> <oj-vb-fragment-param name="actionBar" value='[[ { "applicationId": "ORACLE-ISS-APP", "resource": {"name": $flow.constants.objectName, "primaryKey": "Id", "puid": "Id", "value": $variables.puid }, "subviewLabelExtension": $page.constants.subviewLabel } ]]'> </oj-vb-fragment-param> <oj-vb-fragment-param name="panels" value='[[ { "panelsMetadata": $metadata.dynamicContainerMetadata, "view": $page.variables.view } ]]'></oj-vb-fragment-param> <oj-vb-fragment-param name="context" value="[[ {'flowContext': $flow.variables.context} ]]"></oj-vb-fragment-param> <oj-vb-fragment-param name="row" value="{{ $page.variables.row }}"></oj-vb-fragment-param> </oj-vb-fragment>
-