Get the id of a widget inside a web block

Hi, 

I need to get the id of a widget that is inside a web block. When I name the web block I can select that web blocks id but I'm unable to get the id's of the widgets inside that web block. 

Does anyone have a solution?

Is this a web block you created, or one you're using from a component?

Both. One is in a webblock that I created, the other is an addition that we have put in the default LoginInfo Web Block.

Vincent Koning wrote:

Hi, 

I need to get the id of a widget that is inside a web block. When I name the web block I can select that web blocks id but I'm unable to get the id's of the widgets inside that web block. 

Does anyone have a solution?

If you want to get the ID of any widget which is inside a Web-Block then you can use Trigger Event & pass respective value from trigger to Parent Screen.

Ref:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Reuse_UI/Propagate_Changes_From_a_Block_to_the_Parent


Thanks


Hi Assif,

Thank your for your solution. However I'm currently working with OS10 instead of 11. Is there any method that will work with this version?

Hello Vincent.

In version 10 you can use the Notify (standard way of warn the parent about something up to version 10).

But I would like to point that what you are trying to do, at first glance, is not a good practice and shows your application is somewhat "weird".

A web block is meant to be a standalone piece of interface. The parent shouldn't have access to its inside elements and that's the reason why you don't have access to widgets' ids inside it from outside it.

If you explain why do you need this, we may find a better approach together.

Cheers

Hi Eduardo,

The reason is quit simple. I have create a Introduction/Tour component (Hopscotch) and am using that internally. A tour however is for the currently loaded page, including the Web Blocks. One of things I want people to notice is addition we did for this application in the LoginInfo block. Since that block is in the Menu block I can't target it nicely and I would now need to resort to padding or so. This fails the moment the web page is resized because I can't predict the location of my addition anymore.  

So to make is work again I need the Id of this addition but since it's in a web block I can't select it. That is the issue that I'm trying to solve. Of course the same situation happens in our own web blocks.

Any suggestions are much appreciated.