Genie Discord forum

Author Avatarwerner castro
10/7/2023, 12:26:10 PM

Is it possible to use more than one model within the same app ?

I'm trying to do something like this:

module App

using GenieFramework using Stipple, StippleUI

import Main.UserModel: User import Main.PropostaModel: Cadastro

import Main.PropostaController: cadastroController import Main.UserController: userController

import Main.Views as view

route("/") do usermodel = User |> init usermodel |> userController page(usermodel, view.login()) |> html end

route("/home") do cadastromodel = Cadastro |> init cadastromodel |> cadastroController page(cadastromodel, view.home()) |> html end

end # module

This is user model: @vars User begin id = 0 nome = "" senha = "" email = "" empresa = "" btn_login = false bgmessage = "" iconmessage = "" message = "" opendialogmessagemstatuslogin = false end

The registration model is working normally, however the user model is loaded, but is not changing

Author Avatarwerner castro
10/9/2023, 1:41:29 PM

I discovered the error. For some reason, the label parameter was not allowing the variable to be updated in the component. I just needed to remove the definition of the label="Usuário" field.

textfield("Usuário", , filled=true, dense=true, square=true, type="text"),