Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BasicUI] Problem with image element being root of another page => no access to the sub page #2233

Closed
JensHoRi opened this issue Dec 25, 2023 · 13 comments · Fixed by #2238
Closed
Labels
basic ui Basic UI bug Something isn't working

Comments

@JensHoRi
Copy link

JensHoRi commented Dec 25, 2023

Updated yesterday to last version openhab (4.1.0-1) from earlier Version 4.0.x i believe.

I have a Subpage could be entered with an Image item worked before, now breaking the sitemap.

Here an example (be aware, you need an imageitem, an item called Empty (String in my case) and a group for testing:

sitemap Home2 label="Home Sweet Home" {
    Frame label="Unser Zuhause" {
        Text label="Subpage ok" 			item=Empty {
            Frame label="Sub 1 Frame ok" {
                Default label="Item ok" 			item=Empty 
            }
        }
        Group label="Group ok"				item=gList
        Text label="Grafik (Work around)"						item=owmCurrentConditionIcon {
            Frame label="Sub 2 Frame ok" {
                Default label="Item ok" 			item=Empty 
            }
        }
        Image label="Grafik"								item=owmCurrentConditionIcon {
            Frame label="Sub 3 Frame Broken" {
                Default label="Item never seen" 			item=Empty 
            }
        }
        Text label="Subpage Click not working because of ealier image" 			item=Empty {
            Frame label="Sub 4 Frame never seen" {
                Default label="Item never seen" 			item=Empty 
            }
        }
    }
}
@JensHoRi JensHoRi added the bug Something isn't working label Dec 25, 2023
@lolodomo lolodomo changed the title Image Item kills Basic UI Sitemap for Webbrowser (iOS App still works) [BasicUI] Problem with image element being root of another page (OH 4.1) Dec 25, 2023
@lolodomo lolodomo added the basic ui Basic UI label Dec 25, 2023
@lolodomo
Copy link
Contributor

lolodomo commented Dec 26, 2023

I tried to reproduce your case with this sitemap but I can't, clicking on the images I went to the sub page as expected.

sitemap test15 label="Image as sub page"
{
	Frame label="Several images" {
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Group item=GTest1
		Image url="https://www.openhab.org/openhab-logo-square.png" label="Image example" icon="material:favorite" {
			Frame {
				Default item=TestSwitch
			}
		}
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Image url="https://www.openhab.org/openhab-logo-square.png" {
			Frame {
				Default item=TestSwitch
			}
		}
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Image item=TestImage label="Image example with item" {
			Frame {
				Default item=TestSwitch
			}
		}
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Image item=TestImage {
			Frame {
				Default item=TestSwitch
			}
		}
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Group item=GTest1
	}
}

@lolodomo
Copy link
Contributor

@JensHoRi : I can't reproduce. Can you search what is different from your sitemap and mine ?
My image item is not set, is it important to reproduce your problem ?

@lolodomo
Copy link
Contributor

Ok, interesting, I can reproduce your problem using Chrome or Edge.
It works well using Firefox.

@lolodomo
Copy link
Contributor

I see the same problem with OH3.4.4 and OH 4.0.4. So this is not something new.

@lolodomo lolodomo changed the title [BasicUI] Problem with image element being root of another page (OH 4.1) [BasicUI] Problem with image element being root of another page using Chrome or Edge (OK with Firefox) Dec 26, 2023
@lolodomo
Copy link
Contributor

@JensHoRi : was it working for you in a certain version of openHAB ? If yes, in which one ?

@lolodomo
Copy link
Contributor

lolodomo commented Dec 26, 2023

We even do not need image item, just an image element with URL shows the issue in Chrome and Edge:

sitemap test16 label="Image as sub page"
{
	Frame {
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Group item=GTest1
		Image url="https://www.openhab.org/openhab-logo-square.png" {
			Frame {
				Default item=TestSwitch
			}
		}
		Text item=TestString {
			Frame {
				Default item=TestSwitch
			}
		}
		Group item=GTest1
	}
}

ir with this one:

sitemap test17 label="Image as sub page (no frame)"
{
	Frame {
		Text item=TestString {
			Default item=TestSwitch
		}
		Group item=GTest1
		Image url="https://www.openhab.org/openhab-logo-square.png" {
			Default item=TestSwitch
		}
		Text item=TestString {
			Default item=TestSwitch
		}
		Group item=GTest1
	}
}

@JensHoRi
Copy link
Author

Well, I have an image directly in the item (open weather binding stores that way) but that’s the only difference.

Got the problem in all browsers including Firefox

@lolodomo
Copy link
Contributor

lolodomo commented Dec 26, 2023

Got the problem in all browsers including Firefox

Strange, it works for me in Firefox.

Please replace in your sitemap "Image label="Grafik" item=owmCurrentConditionIcon {" by "Image url="https://www.openhab.org/openhab-logo-square.png" {" and tell me if you still encounter a problem with Firefox.

@lolodomo
Copy link
Contributor

After clearing my Firefox cache, I have the same problem with Firefox !

@lolodomo lolodomo changed the title [BasicUI] Problem with image element being root of another page using Chrome or Edge (OK with Firefox) [BasicUI] Problem with image element being root of another page => no access to the sub page Dec 26, 2023
@lolodomo lolodomo changed the title [BasicUI] Problem with image element being root of another page => no access to the sub page [BasicUI] Problem with image element being root of another page => no access to the sub page, even for the next elements in this page Dec 26, 2023
@lolodomo
Copy link
Contributor

I have not yet any idea why it does not work in OH versions < 4.1 but I know why it does not work in OH 4.1, this is due to the new header row I introduced for image element which should be ignored for image elements being the trigger of a sub page. I am very probably crashing the JavaScript script at least at this line:
https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui.basic/web-src/smarthome.js#L716

@JensHoRi
Copy link
Author

JensHoRi commented Dec 26, 2023

With 4.0.x I didn’t had this issue. I updated very often, every stable version

edit: just looked on my update path:

Entpacken von openhab (4.1.0-1) über (4.0.4-2)

so 4.0.4-2 was earlier version without this issue.

Crazy that all following subpages failing too…

@lolodomo
Copy link
Contributor

With 4.0.x I didn’t had this issue. I updated very often, every stable version

Strange because I can reproduce it easily.
Should check again that my browser cache is really cleared when I switch form one OH to another.

@JensHoRi
Copy link
Author

I'm no developer, but just looked in Firefox analyzing the item:
grafik
event is missing and style of graphic item looks fully different Interesting: Next "normal" Item event is missing to.

Have no idea where this code is build.

Looked your earlier post, but confused with the brackets what to test:
{" by "Image url="https://www.openhab.org/openhab-logo-square.png" {" ???

lolodomo added a commit to lolodomo/openhab-webui that referenced this issue Dec 28, 2023
@lolodomo lolodomo changed the title [BasicUI] Problem with image element being root of another page => no access to the sub page, even for the next elements in this page [BasicUI] Problem with image element being root of another page => no access to the sub page Dec 31, 2023
kaikreuzer pushed a commit that referenced this issue Jan 1, 2024
kaikreuzer pushed a commit that referenced this issue Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic ui Basic UI bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants