This will not work when you use the OH popup action. You must create the popup using the f7-popup component yourself such as in the example at the top of the thread or in the docs:
A popup is hidden by default and only shown when you trigger it via popupOpen or by changing the popupâs opened value to some true value. If you properly use the f7-popup component, this is how it will work.
Navigating to another page is a different action entirely. If you have a page you want to use it will be easier to to that.
I didnât meant the popup to be hidden, but the f7-popup-element on the page. Of course the popup is hidden, but I donât want to see the f7-popup-element within my other oh-label-items. Should be possible I believe.
I have a main page with several âoh-label-itemsâ which can be clicked. On clicking a popup is shown. This popup is another page, but this other page is not shown as whole screen, only as popup (by âactionModal: page:mypageforpopupâ).
Now I want to trigger this popup page by a rule in addition to the âoh-label-itemâ-click. I hope you can understand, what I want to have. It is not that complicated, I only want the popups to be triggered by a rule as well as by clicking on some elements.
But how would this work? What would be a working code? The above code only shows content directly within a popup, but not a page as popup. Does âopened:â work with âaction: popupâ and âactionModal: page:mypageforpopupâ? How?
Iâm afraid I donât understand. The f7-popup is part of the page or widget code. Nothing shows on the page except when the popup that has been defined is opened.
No, this does not work. That is the whole point of this thread and the use of the f7-popup.
Thank you. So any automatic popup of a page or popup-window by a rule is only possible with âopened:â plus âtext: Your popup content goes hereâŠâ and not as normal page popups?
Correct. The only way to communicate between a rule and the UI is through the state of an item. The only way to have the state of an item determine the open or closed status of a popup is to use the popupâs opened property with an expression that includes the item state. The only way to have a popup with the with the opened property is to use the f7-popup element and build your popup with that.
Once you have that working you can also open and close the popup through any other UI component (such as an oh-label-item) which can send commands to the item that controls the popup.
You cannot directly place a page in an f7-poup, and it doesnât really make sense anyway because it is exactly the same number of clicks to navigate to a whole page and back again (one to open and one to go back). You can, however, replicate the contents of that page directly in the f7-popup component or as a custom widget which you can then add to the popup with:
Another question: When the popup is open and I have enabled âcloseByBackdropClickâ, the popup closes, but the state of my item, which rules the popup, still is âONâ.
Is there any possibility to set the item to OFF in this case?
Nope. If you want the item to stay in sync completely with the popup, then you need to add a button to the popup that closes it by changing the item away from the state that opens the popup and make sure that you only use that button for closing and disable the other closing options.
I did some workaround, but this is not âprettyâ.
Another issue I found out:
On my popup I have an mpeg-stream running from a webcam. But this stream runs the whole time, even when the popup is not visible. How could that be?
Is there a setting to stop this or can I do any workaround here? Thanks.
I believe the popup is pre-rendered even when it is not visible so it makes sense that if you have a video stream on the popup that video stream is active.
If you have followed the method outlined above then you have an item for which the state determines the popup status. Just use that same item to set if the url on the image card is blank or connected to the stream:
If you really want to make sure that this gets fully properly refreshed each time the item state changes, then you can add a key property to the card as well bound to the same item state:
Hi, bit late to the party but after some help please.
Iâve added the above to a personal widget and then added it to my pages as a widget.
Triggered my switch item and waitedâŠnothingâŠIâm sure itâs something massively simple that Iâve missed but itâs been a long dayâŠany pointers greatly appreciated!
So when the doorbell is pressed, aDoorBellPress is a switch ON
It should then popup a FrontDoorCamera_Snapshot image from the front door camera
i should have read it more carefully⊠You wrote that you added it to your page.
Letâs check if the popup opens at all and is maybe out of your visible areaâŠ
if the item goes to on, does the page becomes a little bit more grey?
EDIT:
The popup which does not appear - are you triggering the popup by button click or by change of item state? Button click will not work with your button.