Genie Discord forum

Author AvatarWhiskers 1600X3D
11/9/2023, 8:35:59 PM

How to do redirecting of the pages in Genie using the route function? Code is shown below, even though I haven't used route as I was trying to figure out:

using GenieFramework, Genie.Router, Genie.Renderer.Html
using .Stipple, .StippleUI

#Handler Code
@appname gradeinput

#Reactive Code
@app begin
    @in Gradeclicked = false
    @onchange Gradeclicked begin
        
        println("You're now into the Grade Input")
    end
    @in Studclicked = false
    @onchange Studclicked begin
        
        println("You're now into the Student Entry")
    end
end

#UI Coding
function ui()
    row(cell(class = "st-module", [
        btn(class="q-my-md", "Student Entry", color = "primary", @click("Studclicked =! Studclicked"))
        btn(class="q-my-md", "Grade Input", color = "primary", @click("Gradeclicked =! Gradeclicked"))
    ]))
end

@page("/", ui()) 

up()