Targeted navigation widget

Hi guys is it possible to add a target to the navigate widget to choose the iframe it displays in. Eg I have an iframe widget to display say camera images and a series of navigate buttons and when I click one just the iframe changes.I know it is possible to get similar effect with a series of dashboards.

because you can have 10 or 20 iframe widgets inside 1 dashboard and you cant set the name from a widget, it is impossible to create a widget that changes another part from the dashboard.

the only way you can do something like that is create your own custom widget based on the iframe widget and add button to that widget.
for example i have done something like that so my wife can walk trough her recipies:

Ah ok I thought that the iframe was given a name based on the name you gave in the dash then you could target that iframe.i was hoping all I needed to do was add an extra if statement to the JavaScript base widget to choose the target ie either self.command or iframe.command

every widget has an identical name, based on parameters like entity and widgettype, so in theory it should be possible to create complex widgets that target other widgets.

but it would mean heavy rewritting from some widgets.
and you would also like to pickup values from one widget to use it in another.

those kind of widgets would be very specific designed for the other widget.
so allthough it should be possible, its more convenient to design 1 widget with the buttons included like i did.

but i can see why someone would like to have the option to use 1, 2, 3 or even 10 buttons to go with an iframe.
so maybe in the future such a widget could be built.

Sorry @ReneTode II can see from other posts you are an expert on this stuff but just trying to get a handle on all this.Only started using it a couple days ago.but when I look at the html generated it shows the iframe having a id of default-widgetname

so shouldn’t something close to the below code work

        if ("target" in parameters)
        {
            target = "default-" + parameters.target
        }
        else
        {
            target="self"
        }
target.command = command

and this could just be added to the base javascript widget to extend it

1 Like

something like that could work, i think.
but the target then should be the translated widget name.

you then need an if to change the line:

        command = "window.location.href = '" + url + "'"

for a custom widget its certainly doable if you know how to change the widgetname to the used widgetname
i dont know if andrew has a function created to change the widgetname, then it could even be the real widgetname as target.

i dont know if that kind of crossreference usage would cause trouble somehow, but it could certainly be worth a try.

but the buttons would then only be a switch between different links.
and you couldnt use the rotating function from the iframe anymore.