I may be looking at the wrong place. But it seems to me, there is no such a thing (widget) as a simple navigation button used for jumping (action) to another page?
In the standard Label widget, there is an action to define which page to navigate to on the click of the button. But there are also items to define in this label widget.
I assume it should be rather easy to create a widget without anything else as than action (and perhaps to possibility to add an icon). But I have no idea how to create such a widget.
I use those Label card widgets for simple page navigation. You donāt need to set the Item, but rather provide label as ābuttonā text and define action for navigation.
e.g. like this for navigation to network overview page:
Thats what i use as well. It just seem a bit overwhelming just for navigating to a page.
I also feel the label widget is quite big in size.
Looking at the documents, there is a component called oh-button, which is suppose to do the job. So I kind wondered how come there is no such a widget as a button.
I guess I donāt quite understand what distinction you are making here. You can put an oh-button anywhere you can put a oh-label-card. You might feel it looks out of place if you do so without any additional styling, but it will work. Once you add enough styling to a button to make it look like the other default widgets you just get a label card or an oh-cell or, if you are on 4.3 a generic oh-card.
My issue is, how come there isnt such a widget for buttons only.
(I may be doing this all wrong, but I just cant seem to figure out, how to get a simple button used for navigation to another page witth the standard widgets).
As mentioned, I use the Label Widget. But this is not perfect, at it shows a ā-ā where it looks like it wait for a value of an item, which in my case makes no sense, when the widget is suppose to be an navigation to a page.
I inserted the icon (solarpanel). But the sign just right of the solarpanel looks like its waiting for an value/itemā¦ I cant seem to get rid of this when using a Label Widget.
Because in the context of the oh actions, your question doesnāt even make sense.
At a fundamental level, the oh-button component exists to add to some other widget an area that the user can click on to trigger one of the oh specific actions. A card or cell can already be configured as an entire area where the user can click to trigger one of the oh specific actions so there is no sense in adding a smaller area to that entire area where the user can clickā¦
Yes, the general cards and cells have also been expanded to include specific other components with specialized functions (e.g., sliders) or better user experience (e.g., toggles), but since the clicking on a button does not offer either a specialized function or a different UX there is exactly nothing to be gained with an oh-button-cell.
To use a physical example if thereās a smart switch that toggles the lights in a room, you are asking to stick a smart button on that switchplate thatā¦toggles the light in the room.
I donāt know exactly what code you are using for this but
- component: oh-label-card
config:
title: Test side
icon: solarplant
produces a card without any -
and adding a navigation action doesnāt change the appearance:
- component: oh-label-card
config:
title: Test side
icon: solarplant
action: navigate
actionPage: page:page_8f3d590c17
My question is not really about the size of the area (though I would prefere it would be smaller, but thats just my personal feeling).
I used a Label card/widget on a canvas layout page.
This is all standard in OH page editor (MainUI).
All I did in configuring the specific Widget (Name, Label card) was:
Set the action to navigate to a page.
Set the page is should navigate to.
Added a standard OH icon (the solarpanel).
Thats it. Nothing else is configured.
So I did nothing to get the ā-ā sign right next to the icon. And I see no reason why its there to navigate to a page. Thats why I asked how come there isnt a simpl button to use.
Even though I have less experiences with widgets and yaml codes, I must assume it only shows what has been configured, right? Cause there are plenty of other configurations inside the widgets. I just didnt touch any of those configration options.
Ahh,.Thanks. That helped.
I guess I got confused of the Title and the Label, as I assumed the label from an items perspective.
Are you on an older version of OH? Itās possible that the - is still there from before the recent UI card refactoring. The example I showed you up above was also configured using the UI, but Iām on a 4.3 version with the new and improved cards.
Sure, you can do this too. Again, anything with access to the actions system can do these navigation links. In this case you can take advantage of the fact that a basic oh-list-item also has oh actions. So, youāll just want to use an oh-list-card and add a List item to the cardās list. When you configure that item you can give it any text you want, assign a navigation action and select the option that styles it like a button. Because itās a list you can even do this as many times as you want for different pages. This card below was also configured entirely with the UI:
Clicking on the āNavigation linksā header produces no results, but clicking either of the buttons below that navigates to different pages.
That probably explains the - in the card. That was before all the cards were rebuilt, I believe. If you upgrade to 4.3, your label card will not show the - when configure it the way I did.
I donāt know how much the list card configuration has changed since 4.2, however, I have never seen a situation where you canāt configure a card at all through the UI. List cards have existed from the beginning and I donāt recall any other reports of problems. So, without more detail I donāt know whatās going on.
But, if you are trying to configure multiple actions then you want to add list items to the card (the black + button) and configure the action for each list item not the card itself.