« Excellent JavaFX Script Presentation by Matthew McCullough | Main | Gosling Q&A Video from JavaPolis 2007 - Has Lots to Say about JavaFX »

February 15, 2008

Comments

Jim Weaver

These are good questions, t_e_r and EP! I will work up some example programs for your scenarios and post them.

EP

Jim,
Thank you for your excellent examples. This one raises a few questions:
1) Sometimes you need to be able to update a variable using more than one control. For example, let's say I add a text field that is bound to the diameter. As the slider moves, the diameter changes, and the textfield updates. But what would the pattern be so that I can also enter the diameter into the text field and have the model update?
2) What if I only have a textfield and no slider, how does "bind with inverse" work between different types like double and string?

TextField{
columns: 5
value: bind "{cModel.diameter}" //with inverse
},
Button{
text: "Update"
action: function(){
// cModel.diameter = ???
}
}

t_e_r

I am one of your earliest readers - I bought your ebook back in Oct. I have also been studying your blog assiduously over the last few days, trying to decide whether to switch to compiled javafx. I very much appreciate your being such a steady font of good information, when so much is in flux.

I struggled with the interpreted update(replace) trigger and bind. They seemed inconsistent, and not of a generality I would expect. You could bind to a function, but only if its argument(s) changed, thus making it not possible to bind to a function with no arguments. And even with arguments, there are qualifications as to whose function it is.

Since a function may depend on an arbitrary number of other attributes and other functions, including a java method, is it now possible to bind to a java method? (This is very much needed if you want to drive the actions from the data(streamed) side sometimes.) And is binding recursive?

The comments to this entry are closed.

Categories