-
-
Save vpereira/b2c7d252a55a260e38fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.rb | |
class Foo < JrubyFX::Application | |
def start(stage) | |
lbl1 = label "Insert your client number" | |
txt1 = text_field | |
btn1 = button "OK" | |
btn1.set_on_action do |e| | |
# active record objects | |
Posts.all.each do |post| | |
MyController.load_into(stage,:initialize=>[:client_id=>txt1.text.to_s, | |
:post=>post]) | |
end | |
end | |
pane = vbox 10 | |
pane.add lbl1 | |
pane.add txt1 | |
pane.add btn1 | |
pane.set_alignment(Pos::CENTER) | |
scene1 = scene(pane,250,150) | |
stage.scene = scene1 | |
stage.title = "Foobar" | |
stage.show | |
end | |
end | |
Foo::launch | |
### my controller | |
class MyController | |
include JRubyFX::Controller | |
def initialize(args) | |
# get the post and client_id | |
... | |
end | |
on :button_clicked do |e| | |
# the data was edited, reviewed, whatever and the user want to get the next | |
# object being iterated on start method | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment