On Jul 27, 2:04 am, RAlfoeldi <
ralfoe...@gmail.com> wrote:
> Hi Andrew,
>
> thanks for the answer. You obviously had good reasons for your
> approach.
>
> I've extended Image (the object I wanted to bind the UiCommand to) to
> implement HasEnabled and... its probably even the better approach now
> (all the wizbang with opacity etc. nicely wrapped up)
Cool, at some point I hope to get around to adding bindings like
binder.onClicking(HasClickHandlers).invoke(Command) so this scenario
can be supported without a full bind to a UiCommand. Such an approach
would also work with things like onBlur(..).invoke(..) etc too.
>
> Extending Watermark to support HasText and HasAllFocusHandlers would
> be really cool. I - and probably a lot of other people - have wrapped
> TextBox, etc. in more complex widgets with integrated name, error
> message, icons, etc. => No watermarks :-(
After looking at it this is actually a bit harder since HasText isn't
observable and it becomes a bit weird if I'm binding to a
HasValue<String> but sending the watermark to the HasText interface
method. Since you're working with a custom widget anyway a new
interface is probably a better way to go. Possibly a HasWatermarkText
interface where the widget is responsible for displaying it, and
perhaps something like `interface Watermarkable extends
HasValue<String>, HasAllFocusHandlers` where the bindings can do it
automatically.
Would that work for you?