id of widget from outside of platform

id of widget from outside of platform

  
Hello,

I have run across several post with finding widgets id in the forums, but I still have an issue.

I have a screen with a hidden tbox and button, and a fusion chart component. the fusion chart allows an hardcoded link of an javascript function, so I would insert the javascript in the screen, wich clicks the hidden button, passing the value of the hidden tbox (wich came from the fusion chart javascript) to an action inside the webblock.

This works from a screen like a charm, but when I passed all this content to a web block and then tried it, I found that I cannot get the id's of the hidden button and tbox.

If I use a button in the outsystems platform with the code

"funcX('xxx',' "+inpTB.Id+" ');return false;"

on an onclick extend property of the button, I can make it work, but with the javascript hardcoded function I cannot.

So I guess the question are:
  1. Is it possible to know the Id of a widget before runtime? (or establish a extended property and retrieve the widget form it?)
  2. Can I know the widgets id on runtime, from outside the platform? (maybe get the id on preparation, before all the rest, and then inject it on to the javascript functions?)
I'm blocked on this issue, any guidance is appreciated.
Regards,

Rui Pereira
Hello Rui,

you can make it in a simple way, just create an Input parameter (text) in your webblock as mandatory called BtnLnkId for example. and use that paramter in the javascript.

This way you can have all the logic in a webblock, and when using it on any screen you just need to have a link or button on the screen with a name, and then in the input parameter you pass that btn.Id.

is this? or I'm making some misunderstanding?


regards,
Miguel
nope, that's exactly it, I was reading my own post again (helps to think) and started on it, and passed the id's captured in prep in to the action that generates the  javascript (not on the web block, but on the action).

thanks for the help and time you took,

Rui Pereira