cancel
Showing results for 
Search instead for 
Did you mean: 

Message with a link to action

RicardoRomero_1
Active Contributor
0 Kudos

Hi all,

Is it possible to trigger a message with a parameter that have assigned a link to action?

I want to display a message like "Purchase order created with number 99999999" and when the user do a click in 9999999 you can navigate to the PO or do something...

  I've tried to set the parameter enable_message_navigation to 'X', but the message is displayed in gray and I don't know  where can I set the name of the action wich I want to trigger.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create a separate view with that message and a link to action UI with its text property bound to a component controller attribute. You have to show this view as a popup window.

Now on onAction of the link to action write the code to show the PO. Hope this will help.

Regards,

Fareez

RicardoRomero_1
Active Contributor
0 Kudos

Hi, Thanks for your answer.

I thought in do it in that way, but I'd want to know if its possible to do it in a standard way using the class  if_wd_message_manager.

I have to show several messages like this, I don't know  the number of messages..

If it's not possible may be I could use the UI element RowRepeater . I haven't used yet, I need to see if it's usefull for my requirement.

former_member189631
Active Contributor
0 Kudos

Ricardo,

There is no standard way to attach a link with a message but the below is one of the workarounds.

Have a transparent container with text view and link to action UIs, create two context attributes and bind them in text/value propertiesof the UI. Enable/Disable TC when you want hide/display the message. Also set the txt values at runtime. Write your navigation logic inside LTA.

Thanks.

Former Member
0 Kudos

Hi,

if_wd_message_manager is not having any built in functionality to satisfy your need. If you have more messages, the create a view which gets the message text and text for link to action from the component controller's context itself. Have one more attribute as flag. E.g. if flag= PO go to PO else if .... .Set the flag according to your message. I think it will be a good work around.

Regards,

Fareez

Former Member
0 Kudos

Hi,

if_wd_message_manager is not having any built in functionality to satisfy your need. If you have more messages, the create a view which gets the message text and text for link to action from the component controller's context itself. Have one more attribute as flag. E.g. if flag= PO go to PO else if .... .Set the flag according to your message. I think it will be a good work around.

Regards,

Fareez

Former Member
0 Kudos

Hi,

if_wd_message_manager is not having any built in functionality to satisfy your need. If you have more messages, the create a view which gets the message text and text for link to action from the component controller's context itself. Have one more attribute as flag. E.g. if flag= PO go to PO else if .... .Set the flag according to your message. I think it will be a good work around.

Regards,

Fareez

RicardoRomero_1
Active Contributor
0 Kudos

Hi all,

Finally I've solved the problem using a row repeater.
I've created a node 0..n in context with the following attributes:

  • TEXT1 TYPE STRING
  • VAR1 TYPE STRING
  • TEXT2 TYPE STRING

I've created a RowRepeater in the layout with two text_views and a link to action.

Then I only need to fill the table when I want. And the messages will be displayed.

When the action associated to the Link_to_action is triggered I have all the data I need in parameter WDEVENT.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ricardo,

It can be done in the following way.

The message you want to display has a variable part and a static part. Let's assume, "Purchase order created with number" is the static part and "9999999" is the variable part.

Create a context node attribute PO_NUMBER.

Define two UI elements :

1: TextView          Hard Code the text property with the static part of the message.

2: LinkToAction     Bind the text property to the context node attribute PO_NUMBER.

                           Define a action 'NAVIGATE' and assign to onAction property of the UI element.

In the method 'ONACTIONNAVIGATE' read the attribute PO_NUMBER and navigate to the PO details view. Use navigation plugs and pass the value of the PO as an exporting parameter.

Hope this helps...please let me know if you have any further query.

Regards,

Sayan

former_member199125
Active Contributor
0 Kudos

You said when you click on 99999( is it button or link to action ? ) you want to navigate to PO.. so here what exactly you want to call?

if you want to navigate to another view you can navigate using plugs, or if you want to call some url you can call using external window concept..

Can you please elaborate your requirement

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

Thanks for your answer.

The 999999 is not a button or link to action is part of the text of the message. I don't know if I can convert this part of the message in a link to action.

I think I've seen in some standard component something similar, an error for example with a part of the message underlined and when you click there you can navigate to the part of the document that have the problem. In my case I want to call to a URL.

I know  how  to navigate to other views or call a URL, but I don't know if it's possible to add an action to a part of the message.

I'm trying yo use the class if_wd_message_manager. I've seen in the method "report_sucess" there is a parameter called "params" in wich you can pass some parameters that will be replaced in the text using the & writen in it.

This parameter have the structure WDR_NAME_VALUE, that have a name and a value of the parameter, but also have other fields like OBJECT and DREF. I don't know if I can use some of these fields for do what I want, or if it's imposible to do it in a standard way and I need to create a table or something for display the messages with the links....

Thanks.