How to Set an various Image's Popover Text in runtime


Guest

hi every one,

there is many image controls in my view1 and their name is : Image1 Image2 , .....
and want to set their PopoverText , so i create a function with it's own arguments [ID] , [N] and call it , but this not work.

Thanks


DecSoft

Hello starin,

I am very sorry, but the App Builder's script doesn't support nested variables. As a possible workaround, are you trying to use Javascript directly in this case? Take a look at the External Javascript tutorial for more information.



Guest

Thanks david,
yes i know about java script sample , but the problem is i don't know how to set a special image control popovertext.

this code work fine :

i know this code is false but i want to do something like this (there is many pictures so i need to set they by ID):


DecSoft

Hello starin,

Looking at the code I think the scope is not the correct: must be something like "window.App.RootScope.Image". On the other hand, we can't mix AB variables with JS variables in the same JS code. However, I think we meet another problem starin, because follow my previous notes you can thinking on write something like this:

But the above code can't work as expected, because "Image" is not an Array of objects, so we can't use any kind of "index" property here. Then in order to achieve what you wanted, I think we must iterate over all the images, and then assign their appropiate "uib-popover" attribute. This can be does by a code like the below one:

However, that code doesn't work as expected... Certainly the appropiate "uib-popover" is set (we can see it in the Firefox Inspector, for example) but the popover doesn't works as expected. I am try by upgrading the UI Bootstrap library behind the popovers but without success.

I will investigate a little more about this because I am not sure about what can happend here. Maybe I can open an issue into the UI Boostrap project page in order to get some possible help. I am sorry starin but right now you must look for some possible alternative or approach. I will inform here on any news.



Guest

Thanks david :)


DecSoft

Hello starin,

No problem. Just now I am working to upgrade the UI Bootstrap library to the latest version (lot of internal changes must be made) in order to assert we are using it. Then I will to do some other tests in order to achieve what you wanted. I will inform here on any news.



DecSoft

Hello starin,

First of all update your AB copy starin (please consider to buy a license if App Builder is useful for you) because I upgrade the UI Bootstrap library that, between other things, enhance the tooltips and popovers with new possible position and event values.

On the other hand, after a hard research I finally remember that certainly "Image" is not Array, but "RootScope" it is. Then the below code works as expected and may you can adapt to your requeriments. Of course post here if you have any further question.

* The above code changes the "PopoverText" variable of the (suposed) "Image1", "Image2", "Image3" and "Image4" controls.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.