Ui control show and hide groups

Hi there

I just hit a problem that I'm sure someone will know the answer too instantly, but I'm confused.

I was trying to work out how to use the ui control to show/hide tabs/groups etc... this seems/seemed fairly easy thanks to Steve's Node Red Guide.

I used the his code example to hide a group called security_recordings, but when I edited to show the group again nothing happens, What?

{
    "group": {
        "hide": [],
        "show": [
            "security_recordings"
        ]
    }
}

Any help would be much appreciated.

Kind regards

Paul

Is security a tab? and recordings a group?

tab_name_group_name (with underscores)

Hello again E1cid,

Yes it is, bizarrely though it just worked when I tried it again.

I'm not sure what that's about, but I'll take all the help I can get.

Thanks for posting so quickly.

Kind regards

Paul

Hello Again

I don't suppose you could point me in the right direction for this question ( I have tried for several hours, but no joy).

I have a very simple flow (below) where each time someone accesses a particular tab I want to run a python script that checks if there are any files in a particular folder and if so display them.

The flow almost works, but not quite. I thought I could use the ui control node to detect when a page/tab is loaded and then it would trigger the script (as below), but it doesn't work. Moreover it doesn't work in a confusing way

If I just use the inject node its works fine (even though the payload from each is the same).

Also it seems the ui control node does work in some way because the json objects at the end of the flow (that show/hide the group) are exactly the same, yet 1 works the other doesn't.

flows (2).json (3.7 KB)

As ever any help would be great

Kind regards

Paul

Your flow has no ui widgets, so can not see it working or not.

The ui-control will output on connect refresh change of tab etc, so it may be over loading the python script(just a guess). You may want to add a switch node to only pass if the tab name is correct.

Take a read of this (a google search using 'node-red ui-control example' pop this as the first hit)

Hi E1cid

Sorry that wasn't the actual flow, I just copied a bit of it.

See attached ( its a bit of a mess, since I started trying to find out why it didn't work

Kind regards

Paul
flows (3).json (11.5 KB)

Thanks zenofmud,

I've already read it actually, his site is brilliant, but it didn't seem to cover this eventuality.

Kind regards

Paul

The issue is the if statement

if (msg.payload == "not empty") {

it appears to be always false, if you comment it out the group shows

thanks v much E1cid, I'll have a look at that function node

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.