RuntimeId not present after copy to another eSpace (before publishing)

Hi Forum,

When I copy or cut/paste a webblock from one eSpace to another, in the target eSpace the reference in Scope > locals to the webblock itself is not present until after publishing and closing / reopening the target eSpace.

This creates a chicken-egg problem when the webblock uses references to it's own RuntimeId (ie in JavaScript or AJAX Refreshes. Can't publish because of non existent RuntimeId, but that will be there after publishing.

Anyone had the same problem? Known issue perhaps?


Regards,


Arthur

Using OS11, ServiceStudio 11.5.44


Hi Arthur,

Not sure what you are trying to do. RuntimeId is not something you tend to use in Outsystems. Could you explain a bit more why you need the RuntimeId.

https://www.outsystems.com/forums/discussion/36015/how-to-get-the-runtime-id-of-a-web-block/



Hi Stefano,

Thank you for your reply.

I'm referring to the property as seen in the image. 

I use it in JavaScript of the block to get a unique id in the HTML DOM. I think that's why it is there, isn't it?

  

Hi Arthur,

Not sure if a webblock always have that. If you read the link i enclosed you can see Eduardo and Killian explained that a webblock sometimes does not translate into a HTML component with ID.

Perhaps if you can explain more why and how you use the Id we can find the best way to get done what you need ni Outsystems.


Hi Stefano,

The post you referred to is about server interaction with the RuntimeId.

In my usage I use the RuntimeId to dynamically create a unique variable in JavaScript for the page at runtime for that webblock.

Example JavaScript (part of it) :

SyntaxEditor Code Snippet

var "  + CarouselCustom.RuntimeId + "_custom_carousel = function() {

I understand. But as said before: a webblock does not exist. It will be translated into HTML accordingly. Meaning the webblock will not have an ID. The components used in the webblock will.


The example: if you create a webblock in Outsystems that is empty, you will not find it on the page. If you put a container in it, the container will be translated into a div. The webblock itself will not have any equivalent.