RT-25559 Allow event handlers to come from the namespace

Milan Kubec milan.kubec at oracle.com
Fri Jan 25 00:04:52 PST 2013


Thanks for your opinions, the result of this "poll" is quite clear, I
will use $ as prefix.

   Milan


Dne 24.1.2013 15:11, Danno Ferrin napsal(a):
> +1, when other non-event attributes use $ they look in the namspace via the
> KeyPath (for expressions), which is either populated by hand or from other
> declared objects.  Keeps a constant expectation.
>
> On Thu, Jan 24, 2013 at 4:21 AM, Daniel Zwolenski <zonski at gmail.com> wrote:
>
>> I've always wanted the ability to have any bean in the scope and be able
>> to arbitrarily reference properties and methods on it as needed, ideally
>> using the $ syntax for everything.
>>
>> Eg
>>
>> <Button text="$myModel.someValue" onAction="$myPresenter.doSomething">
>>
>> Where I add myModel and myPresenter to the FXMLLoader scope via something
>> like set("myModel", new MyModel()), etc.
>>
>> This would stop the hard "controller" concept and allow developers to use
>> whatever pattern they like (eg bind directly to a model, etc).
>>
>> There's some issues on tool support for this (ie the tools don't know the
>> type of myModel) but there are plenty of options around this - discussed
>> previously but I can find them if there's any interest.
>>
>>
>>
>> On 24/01/2013, at 7:32 PM, Tom Schindl <tom.schindl at bestsolution.at>
>> wrote:
>>
>>> Hi,
>>>
>>> # is not good because it means for tools to look at the attached
>>> controller so you'll overload the meaning of # and tools can't e.g.
>>> shown an error when there's not such method on the controller.
>>>
>>> Tom
>>>
>>> Am 24.01.13 09:24, schrieb Milan Kubec:
>>>> Hello,
>>>> mentioned issue suggests to search also FXMLLoader namespace for event
>>>> handlers. That's good idea but the open question is how to prefix the
>>>> name of the event handler - either with # as event handler method or
>>>> with $ as reference to Namespace, both are correct in some sense.
>>>>
>>>> The fxml code would look like this (no controller is defined):
>>>>
>>>> <?import javafx.fxml.Widget?>
>>>>
>>>> <Widget onNameChange="#manualAction"/>
>>>>
>>>> or
>>>>
>>>> <Widget onNameChange="$manualAction"/>
>>>>
>>>> For reference: http://javafx-jira.kenai.com/browse/RT-25559
>>>>
>>>> Thanks
>>>>
>>>>  Milan
>>>>
>>>
>>> --
>>> B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
>>> ------------------------------------------------------------------------
>>> tom schindl                 geschäftsführer/CEO
>>> ------------------------------------------------------------------------
>>> eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
>>> http://www.BestSolution.at                      phone    ++43 512 935834
>
>



More information about the openjfx-dev mailing list