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

Some answers to issues #2

Open
PGimenez opened this issue Aug 24, 2023 · 0 comments
Open

Some answers to issues #2

PGimenez opened this issue Aug 24, 2023 · 0 comments

Comments

@PGimenez
Copy link
Collaborator

PGimenez commented Aug 24, 2023

About mixins

The @mixin macro is used to extend the ReactiveModel behind a page with fields from another struct, as you've already done.

It's like what Mixers.jl does, but with some improvements for Stipple as introduced in this issue.

One caveat is that @mixins only works with named models, those created with @app ModelName begin .... We've open an issue on this.

Are @in and @out conventions?

@in variables can be read and written from the UI, whereas @out can only be read. Here's an example:

using GenieFramework
@genietools

@app begin
    @in textin = ""
    @out textout = ""
    @onchange textin begin
        @show textin
    end
    @onchange textout begin
        @show textout
    end
end

function ui()
    [textfield("readwrite", :textin), textfield("readonly", :textout)]
end


@page("", ui)

The textout handler is never triggered as textout is not writeable.

Can we use @page with an existing model?

I don't think this is possible at the moment. We did something similar in the workshop to include multiple pages, but you need to pass the entire module:

@page("/eda", "app/EDA/ui.jl", "layout.jl", Main.App.EDA)
@page("/ml", "app/ML/ui.jl", "layout.jl", Main.App.ML)

This would be an useful improvement to the API in order to make working with multiple ReactiveModel in a page easier.

Is there a way to make a loading screen? isprocessing is not working

You can use the q-inner-loading component. There's also a loading option for buttons.

using GenieFramework
@genietools

@app begin
    @in disable = false
    @onbutton disable begin
        println("button disabled")
        sleep(5)
    end
end

function ui()
    [h1("Header"),
        btn("Disable", @click("disable = true"), loading=:disable),
        quasar(:inner__loading, showing=:disable)]
end

@page("", ui)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant