tag:blogger.com,1999:blog-3646845225376270865.post5927463695062863028..comments2024-03-27T14:08:14.967+01:00Comments on Java, the Programming, and Everything: Be careful binding to functions in JavaFXAnonymoushttp://www.blogger.com/profile/18266250262860035187noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-3646845225376270865.post-87975783661162040702009-05-30T23:11:57.896+02:002009-05-30T23:11:57.896+02:00Brute. I've broken my world ;]Brute. I've broken my world ;]Leszek Gruchałahttps://www.blogger.com/profile/00088047976523414378noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-25138424864910772912009-05-30T22:35:00.767+02:002009-05-30T22:35:00.767+02:00I checked it. It doesn't work.I checked it. It doesn't work.Anonymoushttps://www.blogger.com/profile/18266250262860035187noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-74449586871499991232009-05-30T22:23:53.217+02:002009-05-30T22:23:53.217+02:00Maybe yes, because the value of p inside the funct...Maybe yes, because the value of p inside the function will be changed during the second invoke... or maybe just not ;-)Leszek Gruchałahttps://www.blogger.com/profile/00088047976523414378noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-57004038151407299202009-05-30T21:44:30.539+02:002009-05-30T21:44:30.539+02:00Leszek, I'm afraid p = p; won't work. "bound" anal...Leszek, I'm afraid p = p; won't work. "bound" analysis the function, and is aware that p does not affect return value.<br /><br />What would I do? I wouldn't use binding. I would just call System.currentTimeMillis() every time I need.Anonymoushttps://www.blogger.com/profile/18266250262860035187noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-79677510458751257752009-05-30T14:13:59.715+02:002009-05-30T14:13:59.715+02:00When I was at the beginning of the last example I ...When I was at the beginning of the last example I thought: Ha! I know what you want to do!. Add 'bound' and everything should be fine. And.... WTF?!<br /><br />I didn't check this, but it should work:<br />bound function getValue(p:Integer) {<br />p=p;<br />System.currentTimeMillis();<br />}<br />But this only changes the value only for two first results. Maybe you found out how to 'fix' it? ;-)Leszek Gruchałahttps://www.blogger.com/profile/00088047976523414378noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-68831941248985298782009-05-30T14:11:17.319+02:002009-05-30T14:11:17.319+02:00This comment has been removed by the author.Leszek Gruchałahttps://www.blogger.com/profile/00088047976523414378noreply@blogger.comtag:blogger.com,1999:blog-3646845225376270865.post-8316893190007967822009-05-24T10:22:17.110+02:002009-05-24T10:22:17.110+02:00Binding is one of the most powerful function in jf...Binding is one of the most powerful function in jfx. But when programmer don't understand how those it work then fail ;)<br /><br />Remember that binding variables could not be animated and changed to normal variables:<br /><br />var d = 8;<br />var e = bind d;<br />e = 9; // doesn't work, runtime failKoziołekhttps://www.blogger.com/profile/17083309584011564718noreply@blogger.com