nclark
February 18, 2025, 3:18pm
1
The problem I'm having is how to add some vertical space between the two HREF boxes on the same line.
Here is the code of one of the lines...
href name: "configMorningPreEventsHref", page: "configMorningPreEvents",
title: "${btnIcon('pi-angle-left')} ${btnIcon('pi-sun')} Morning Pre Event Actions", description: "", width: 4, newLine: false
href name: "configMorningEventsHref", page: "configMorningEvents",
title: "${btnIcon('pi-sun')} ${btnIcon('pi-angle-right')} Morning Event Actions", description: "", width: 4, newLine: false
I tried adding a paragraph statement in between but that of course makes a new line automatically. I'm not very good with CSS and containers and was trying to maybe have some CSS just before those buttons, add some padding and closing the container after, but I just can't figure it out.
Any help would be appreciated.
Could try something like:
href name: "configMorningPreEventsHref", page: "configMorningPreEvents",
title: "${btnIcon('pi-angle-left')} ${btnIcon('pi-sun')} Morning Pre Event Actions", description: "", width: 4, newLine: false
input name: "spacer", type:"hidden", title:" ",width:1, newline:false
href name: "configMorningEventsHref", page: "configMorningEvents",
title: "${btnIcon('pi-sun')} ${btnIcon('pi-angle-right')} Morning Event Actions", description: "", width: 4, newLine: false
nclark
February 18, 2025, 4:17pm
3
thebearmay:
input name: "spacer", type:"hidden", title:" ",width:1, newline:false
Thanks, that does work but is a bit of a large space, with the width changed to 3 for the buttons, it does look better but not exactly the vision in my head, sometimes you have your hands tied and need to work with what you have. Hope we will one day more control over the layout of the menus.
Takes a little more work but:
String l1 = buttonLink("configMorningPreEvents", "${btnIcon('pi-angle-left')} ${btnIcon('pi-sun')} Morning Pre Event Actions",'','','',20)
String l2 = buttonLink("configMorningEvents", "${btnIcon('pi-sun')} ${btnIcon('pi-angle-right')} Morning Event Actions",'','','',20)
paragraph "<table><tr><td>$l1</td><td> </td><td>$l2</td></tr></table>"
if(state.configMorningPreEvents){
state.configMorningPreEvents = false
paragraph "<script>window.location.replace('${appLocation()}/configMorningPreEvents')</script>"
}
if(state.configMorningEvents){
state.configMorningEvents = false
paragraph "<script>window.location.replace('${appLocation()}/configMorningEvents')</script>"
}
String buttonLink(String btnName, String linkText, color = "#1A77C9", bkColor = "#FFFFFF", font = "15px", bWidth=15) {
"<div class='form-group'><input type='hidden' name='${btnName}.type' value='button'></div><div><div class='submitOnChange' onclick='buttonClick(this)' style='border-radius:25px;color:$color;background-color:$bkColor;cursor:pointer;font-size:$font; border-style:outset;width:${bWidth}em;'>$linkText</div></div><input type='hidden' name='settings[$btnName]' value=''>"
}
def appButtonHandler(btn) {
switch(btn) {
case 'configMorningPreEvents':
state.configMorningPreEvents = true
break
case 'configMorningEvents':
state.configMorningEvents = true
break
default:
log.error "Undefined button $btn pushed"
break
}
}
String appLocation() { return "http:${location.hub.localIP}/installedapp/configure/${app.id}/mainPage" }
This is one of the reasons why I made this post below.
Which I know you already have found and are working on.
Check out these sexy buttons now
[image]
[image]
The Refresh I only need to do some actions and reload the page, which the built in input buttons will do. Adding the icon is just borrowing some code from the regular UI (btnIcon function is below). You can find the button names with the browser F12 console and inspecting the icons in the normal UI. Also I found an icons list here: PrimeNG OR PrimeFaces Showcase
input name: "btnListRefresh", type: "button", title: "${btnIcon('pi-reβ¦
1 Like
nclark
February 18, 2025, 7:03pm
6
ok thanks guys, I finally got Jeffs' code to work correctly as stated in the other thread he linked to.