Popup link id must be the id of a Link or Button Widget with Method Navigate.

Hi,

I'm experiencing this type of error Popup link id must be the id of a Link or Button Widget with Method Navigate. whenever i use link inside table records widget that is inside the web block to reuse this table. I did not use pop up, just a link to another page (navigate).  Any experiences regarding this issue?



Service Studio version: 10.0.704

Platform Server version: 10.0.405.0

Service Studio version: 10.0.613 and Cloud Environment and it is fine:

try to search whether you use popup, instead.

regards,

bb

Hi BB,

I'm very sure that i'm not using any pop up editor in this web block


Actually, this link was working back then. I don't know exactly what triggers the error. I did not do any version updates to both Service Studio and Platform server.

Solution

Hello Cyril,

If you want to open a window as PopUp, you need to follow these rules:

1. Guarantee that the link is defined to Navigate.
2. Guarantee that the link has a Name (sometimes we give the name to the text/expression or a Container where we put the link.
3. Guarantee that the PopUpEditor can see the link.

Regarding the point 3, by the image, I'm not seeing the PopupEditor together with your link.
if you put it "outside" the list line, it will not be able to find the link (even if in design mode it find it).

So, I would say that if you put the PopUpEditor at the side of the link, it will work, as the list will create a PopupEditor  for each link in the list.

Also, if you have any IF that will show/hide the link, the PopUpEditor also must be inside the IF.

Cheers,
Eduardo Jauch

Solution

Hi Eduardo,

My purpose is just a simple link to redirect (Navigate) to another page that's why i don't know why I'm getting this kind of error. 


Kind regards,

Cyril

Hello Cyril,

The error is happening in the page where you have the link to the other page, or happens when you enter the other page?

In one of them (or in the web block), you have a PopupEditor that is assigned to an element that

a) is not a link/button

b) is a link/button but is not set to navigate.

Find the PopupEditors in the page where the error is happening, and you should find the responsible :)

Cheers,
Eduardo Jauch

Find usages of PopUp_Editor (F12) from Rich Widgets and check at how many locations you have used that and check whether you have provided correct link id to it or not.

Hi Eduardo,


Yes, It happens when i enter to other page. It seems that i have a PopupEditor in that page. As i checked on the properties, names based on the guide you've given, it is all configured well but still the issue remains. 

 I managed to fix the issue by reinstalling the Service Studio. 


Thank you for the answers! 

Hi Cyril,

Just for future reference, sometimes, Service Studio can get a little "lost" (its "internal state" got corrupted).
Usually, closing and open it again solves the issue. 

So, next time that an error is happening and you don't know what it is and can't find a logical reason, first, try to logout and login again in the application (can be a session issue), than, try to close and open again the SS (and publish again).

Cheers,
Eduardo Jauch

Hi Eduardo,


Yes, I've already done that process Login in and out even republish the eSpace in Service Center but still getting the error. Anyway, thanks for the help! really appreciate it.   


Thanks,

Cyril

This appears to have been resolved for the user. So for future users, I solved this issue by removing a conditional operator on my link's Enabled property (No clue why those two items are linked, but all the popup's had the correct link ID's and the links were set to navigate AND I logged out and back in and was still receiving the error).

Seems like when the link's enabled property was set to false I would receive the error. As soon as I switched that to true the error stopped occurring. (I was trying to set it up so that the user could only access a pop-up after they had filled out the main form.)

I would consider that a bug - the popup should not explode if the link it's pointing at is disabled.

It can see the widget and all, but it's OutSystems behaviour to remove the href and onClick for Enabled=False links:

I think it should exit without error. Maybe set a var widget = outsystems.internal.$(widget); and return [linkHref, isAButton, widget !== null] and only throw that exception if var hasWidget = getLinkResult[2]; ... if (!hasWidget)

My two cents, anyhow :)

-- Ritchie

Ritchie is right. This is an ugly bug, but we can avoid this using an if statement into the popup LinkOrButtonWidgetId field like below:


If(myLinkIsAvailable, PopupLink.Id, WhateverYouHaveinScreen.Id)


So, the idea is: If the popup link must be disabled, point to another button/link id, otherwise point to the right Popup Link id.

Rodrigo Camargo wrote:

Ritchie is right. This is an ugly bug, but we can avoid this using an if statement into the popup LinkOrButtonWidgetId field like below:


If(myLinkIsAvailable, PopupLink.Id, WhateverYouHaveinScreen.Id)


So, the idea is: If the popup link must be disabled, point to another button/link id, otherwise point to the right Popup Link id.

I have the same problem and this solution work for my case. Thx


Another solution is to encapsulate the Popup_Editor in a if container and only show it when the link it's pointing to is enabled.

This alternative seems better in my opinion.

Example:

Rodrigo Camargo wrote:

Ritchie is right. This is an ugly bug, but we can avoid this using an if statement into the popup LinkOrButtonWidgetId field like below:


If(myLinkIsAvailable, PopupLink.Id, WhateverYouHaveinScreen.Id)


So, the idea is: If the popup link must be disabled, point to another button/link id, otherwise point to the right Popup Link id.

Hey Rodrigo,

Sorry for reopening this thread, I'd like to ask how do I form the 

myLinkIsAvailable

condition?


Thanks in advance!

Marios


Hi Marios,

This is a boolean variable. You can use any condition that will return true or false, accordingly your needs. 

Cheers.

Eduardo,

The only property available for the Link is the ID. This is the condition I use but It doesn't seem to work.  

SyntaxEditor Code Snippet

If(Link_ExpDate.Id <> NullTextIdentifier()

Shall I do something different?


Marios


Hi Marios,

Don't use that approach.
Put an IF widget around the PopupEditor widget and define its condition as the condition you used in your example.

Usually, I put a named container around the link AND the IF with the popup editor in it. When I want to enable disable the link, I refresh the container. This will re-execute the IF and build or not the popup editor, preventing the error if the link is not enabled and at the same time keeping the popup editor linked correctly to the link.

Cheers.

I tried to enclose the popup in an IF statement, but it didn't work. And I'm not sure how and when to refresh the container Could you show me what you did, please? 

Thanks!

Hi Marios,

First: What are you trying to accomplish?

Second: What do you mean by "Not working"? (as in what was you expecting to happen and what happened)

Cheers.

I want to enable/disable the link based on a specific condition.

The enable/disable works, but when I go into the screen that has the link I get this thread's title error message  (Popup link id must be the id of a Link or Button Widget with Method Navigate)

I tried to enclose the popup in an IF statement with the condition I mentioned above, in order to pick the appropriate link, but the error persists.

Cheers

Hi, this will help you.

The link starts disabled (your situation). When enabled (toggle it), you will be able to open the Popup.

Cheers.

OK Eduardo,


This worked, Thanks!


Marios