RT-25559 Allow event handlers to come from the namespace
Daniel Zwolenski
zonski at gmail.com
Thu Jan 24 03:21:12 PST 2013
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