Clear button click listener in droidparts ClerableEditText - android-edittext

I want to have a click listener for the clear button in the ClerableEditText from droidparts.
Thanks.

You can set a ClearableEditText.Listener instance which didClearText() method will be called when the clear button is pressed(or actually released).

Related

TToolbar Button with dropdown menu greyed out

I'm having issues getting a TToolbar Button to appear "enable"
The button has an Action assigned to it - which is fire by the OnClick event
It is also setup with a Drop Down Menu, which has 2 options on it, both of which are enabled, and both of which fire off when clicked.
Despite all this the TToolbar Button steadfastly remains greyed out, but accepts the clicks.
Any suggestions?
You're doing things wrong. :-)
When using actions, you don't use the button's OnClick event - you put the code in the action's OnExecute event instead (because that's what's executing - the action - and not the button). When an action is assigned to the control, the control cannot be enabled until there's a handler for the TAction.OnExecute.
The reason for using actions is so you can put the code in a single place (events related to the action), and then every single control attached to that action uses that common code to perform the same functionality. Editing the code in that single location means all controls attached to that action see the same changes.
If there's nothing attached to the TAction.OnExecute event, the control has nothing to do if it was selected (clicked), and so there's no reason to enable it in the first place.
In case someone else comes across this, I just had this problem (using Delphi 10.2 Tokyo).
For some reason, the "EnableDropdown" property on the TToolButton caused the button to to be greyed out when set to true. Setting this property to false seems to have resolved the problem for me (the dropdown menu remains functional anyway).

How to disable a button after click in limejs

How do I disable a button after click in limejs? I have tried using
this.disable()
but it does not work.
You can also use goog.events.listenOnce. Identical signature to goog.events.listen and will only fire once.
Try goog.events.listen and goog.events.unlisten:
goog.events.listen(my_button, ['mousedown','touchstart'],function_triggered_onClick);
goog.events.unlisten(my_button, ['mousedown','touchstart'],function_triggered_onClick);
goog.events.unlisten will disable the button untill code reaches goog.events.listen again

primefaces notificationbar autohide

I have a notificationBar and a commandButton to show it. It works fine, but I need the notificationBar hide itself without the need to click a commandButton to hide it.
Is this possible?
Thanks.
Generally what you have to do to close the notificationbar is the following is to call notificationWidget.hide() when you specified widgetVar="notificationWidget" as a attribute of the notificationbar.
If you would like to have a cross inside the bar to close it, you have to put a commandButton or just a button inside the notificationbar and which calls notificationWidget.hide() on click.
To close the notificationbar after some fixed time you have to register a timer when the notificationbar shows. I.e. setTimeout(notificationWidget.hide, 3000) to close it after 3 seconds.
If you know more exactly what you want to do give some more information or some code, so that i can give you some more concrete answer.

How to implement radio button in iPhone?

I want to add buttons like radio button. i have created round rect button but no idea about radio button.
How can I do it? This how I implement checkbox button feature.
any help please ?
The best way of achieving this is setting a normal and a selected image for each button. You can then easily switch each button on or off using the selected property:
myButton.selected = YES;
There is no direct UI for radio button you have to use images on UIbutton so that you can replace the checked images when a user press on the button just like tableview check/ uncehck functionality .It is just a trick by which you can make feel of a radio button.
I've written a controller for handling the logic behind an array of radio buttons. It's open source and on GitHub, check it out!
https://github.com/goosoftware/GSRadioButtonSetController
Check out DLRadioButton! It supports not only radio buttons but also checkboxes. If you have any questions, please feel free to leave a comment.

Delphi: ToolButton & Action - funny

I have a tool button and an assigned to it action. But the action doesn't have an on click event, there is no code for a click. Therefor the button is disabled, how to change it to be enabled?
Thanks!
When an action has no OnExecute handler, the action is always disabled. If you want to assign an action to an object, and have that object be enabled, then you need to provide an OnExecute handler.
The question sounds a little odd though. Why would you have a button which, when pressed, does nothing? Do you perhaps, have an OnClick handler that is defined in the button rather than the action? If so then you should simply move that handler into the action and all will be well.
Update
Ulrich helpfully points out that the DisableIfNoHandler of TAction can be used to change the behaviour described above. Since this has public visibility and is not published, you have to make the change in code which is why I think I forgot about it.

Resources