if I use a button to open a dialog, the button doesn't change the status to normal (stay on ui-state-hover).
How can I tell the button to change back after clicking on it?
Hope some1 can help me :)
I believe ui-state-focus is the class that's being added when the button is clicked. If you add this to the end of the buttons 'click' event, it should reset it to a normal state.
$('#button').toggleClass('ui-state-focus');
Related
Can anyone explain me what the difference between focus, focusleave and focusenter on button method with extjs, I'm lost because it seems to be the same when I add event listener. Thanks
kind regards
difference between focus, focusleave and focusenter on button method
with extjs
Method? I guess you mean the events right? Cos:
The focus method will focus your button when you call it.
As you can see on the picture the middle button has focus, you can change the focus on the webpage usually by using TAB key. ExtJS supports full control over your app using keyboard.
The focus, focusenter, focusleave events. If you are not sure what to use - just use "focus"
The focus event should be clear - it's simply fired when the button has focus.
The focusenter is fired when the component get's focus but as the docs states it's also fired in the whole component hirearchy. That means that if the button is in panel which is in view and you focus the button - the focusenter will be fired on the view, panel, button.
main -> panel -> button
Events
The focusleave is the same as focus enter. Fired when focus is lost on the component - again fired in the whole hirearchy. So if the focus went completly away form the page you would see focus leave on the button -> panel -> view
I'm currently using Unity 5 GUI system and having one issue with the Highlighted Sprite Button Script. Under the Button Script / Sprite Swap / Highlighted Sprite, I can keep the highlighted sprite to stay highlighted, but once I clicked outside the button, it goes back to normal or the highlighted state goes away.
I wanted to the highlighted button to stay on so that the end user know which scene they are in.
How can I keep the highlighted state on until I press another button?
You might want to use a toggle button rather than a Button.
You can just use disabled sprite instead of highlighted sprite and disable and enable each button as per you requirements.
Disable the button according to your scene, you can keep it disabled unless you press any other button. After your scene change just enable the old button and disable new pressed button.
i have a choice list with different action (add file or add comment) and a button OK.
The button will show pop up according to action select. My question is how i do this in same button?
I create two pop up's but i don't know how to invoke them after.
You could change the text on the button per pop up window. Then when the button is clicked, pick your pop up based off of the text on the button. For example, initial state of the button says open, then when its clicked you display a pop up and change the button text to close. Then when the button is clicked again you close the window and change the button text to open.
I have write a code for radio button click by using XPath but it is not click on radio button during execution of code.
My code is:
driver.FindElement(By.XPath("//a[contains(id(),rptShoppingServiceGroup_dlAddons_2_ctl01_2)]")).Click();
Kindly help how to button select particular radio button and after selection it move to another radio button.
Thanks in advance.
Actually the click() works, but the webdriver can't properly refresh the user interface...
The unique methode i've found to refresh that is to use the submit() function on it.
Like :
myRadioBtn.click();
myRadioBtn.submit();
tell me what's up =)
It might be case that you're checking radio button which is already checked. Hence now, you have radio button unchecked which you don't want(you want radio button to be checked). First check whether radio button is checked. If it's checked, don't click on it(otherwise, it'll result into uncheck of radio button). If it's not checked, then click on it so it will be checked.
button = driver.FindElement(By.XPath("//a[contains(id(),rptShoppingServiceGroup_dlAddons_2_ctl01_2)]"))
if (!button.isSelected()){
button.click();
assetTrue(button.isSelected)
}
Do you want RadioButton checked?
if yes, try ...Checked=true
var radioButton = driver.FindElement(By.XPath("//a[contains(id(),rptShoppingServiceGroup_dlAddons_2_ctl01_2)]"));
radioButton.Checked=true;
(or radioButton.Click())
I created a Button in MXMXL. On button click, I create a Menu as a child of the Button. I am using an XML datasource. The reason for creating it this way, was due to the amount of custom skinning involved. A popupmenubutton was not an option. Anyway, so my question is this: when clicking the button, the menu is displayed. However, if you click the button again, the menu reopens. I want the menu to close if the user clicks the button a second time. Now, I got it to work by setting a var after opening the menu, and then I check that var on each click to make sure that the menu isn't already open. If true, then it will close the menu, instead of reopening it. This works, until the user clicks away, in which the HIDE event gets dispatched and the menu closes. My hack no longer works.
Any suggestions? I spent hours trying different things. The hardest part is trying to destinguish from that second button click when the menu is open, and when the user clicks away from the menu. They both dispatch the HIDE event.
Help!!!
Have you tried adding another eventlistener to the button...FlexMouseEvent.MOUSE_DOWN_OUTSIDE ? You should then be able to set the preventDefault event to true to stop the event from firing anything else and stop the menu from closing.