How to open a vaadin combobox programmatically - vaadin

I have implemented a poor-mans-searchbox using a combobox. The search expression is typed into the textfield and the user press enter. Then the search expression is added to the combo model, this is caught in the eventhandler which then runs the search, empties the combo list and populates it with the searchresults instead. However, the user then need to open the combo list manually (by pressing the little down-arrow) to see the result. It'd be nice to open the list automatically, but I haven't found out how to do that. Does anyone know?
Also the search should be performed each time the user presses a key, and not only after enter is pressed.

Not as the poor man's solution, but you may extend the client side to do that. Tipically, the client side widget would have some method like "openResultsBox" or something similar. You could call that to open up the box. Vaadin 7 also allows you to write extensions which basically lets you extend the client side for exactly doing the very same slight changes. I am not sure why you have chosen the combobox for that though.

the vaadin-combo-box component offers a method called "open" so simply call
reference-to-element.open();
Should do the trick.
Relevant official docs here:
https://www.webcomponents.org/element/vaadin/vaadin-combo-box/elements/vaadin-combo-box#method-open

Related

Is it possible to load a dynamic website and trigger a search field inside of it?

I am new to Delphi and I want to know, is it technically possible to perform this task?
Firstly, I want to load a dynamic website, and then search it using an external input field, as in the picture.
When I enter a search parameter in the left side, it should perform a search operation in the loaded website.
Yes, it is technically possible.
On the right side of your application window, you should drop a TWebBrowser (This is actually based on Internet Explorer) or the new TEdgeBrowser.
You can then use those component's methods to make them load the page you want to.

process enter key using wx_erlang (erlang port wxwidgets)

I am building a simple browser in erlang, using wx. This simple browser has a text box for entering a url. I want to execute a callback when the user presses the enter key while in the text box.
I can see several potential ways of doing this, one option would be to process each keypress event, and execute its default action unless it is an enter key, in which case the custom processing occurs.
I was hoping there might be a higher level event I could use, like control lost focus. I am new to wx, and do not mind if programmers using other tools comment as the question (at this stage) is more about using wx that a particular language binding.
Not sure how is it called in wx_erlang, but there is wxEVT_TEXT_ENTER event to which you should bind. Note that you must create the control with wxTE_PROCESS_ENTER style to get this event.

Appium Detect Alertdialog

I'm writing a UI test script in Python, after performing a click, there might be an alert window popping up. If so, I need to press a button on that window. I wonder if there's a way to detect alert dialogs in Appium API? Thanks.
simple and best way is doing through capabilities
capabilities.setCapability("autoAcceptAlerts",true);
This will only accept alerts from your App and not the system Alerts.
Place your pointer on Yes, No button, you will get ID's of those if they have separate ID's. Then use
self.driver.find_element_by_id('id of the button').click()
If they do not have ID then use
self.driver.find_element_by_name('OK').click()
I think this is a bit unrelated to the question, but I hope this will give you a clue.
You can use the XPATH to locate the element. well, this approach is not really recommended. But this could be useful if the element is doesn't have any ID, accessibility name, name, or label. where the information is only class, and value.
for example you could do something like this:
//android.widget.Button[contains(#text,'OK')]
I am not sure about the class name for Alert dialog on android. But this is my approach when facing some problem on iOS automation, for example my app have custom alert with 3 button (all of them is customized), button Open, Close, and Report:
//UIAAlert[*]//UIAButton[#name='Report']
You could do same approach to locate any element which is unable to locate by normal approach.

Disable Auto Shipping Update in Magento Admin

If you've used the Magento admin, then you know that when you tab between the "Shipping Address" order screen it's kind of buggy. It does an AJAX call behind the scenes anytime that any field is updated. This keeps the shipping up to date, but its very annoying when trying to key in orders. Does anyone know a good way to disable this automatic functionality, so that it could be done with a button, instead of happen "automagically"?
I can't point to anything specific at the code level, as I don't have the code handy to look at just now, but I know it won't be easy per-se.
You will need to find and rewrite (unless it's all in the templates, then you'll need a custom admin theme) the block which generates that form, strip out the calls which add the handlers to the onblur events. Theoretically, your button should be able to call the same JavaScript method which is called via the onblur of the form elements.

How to create a Login/Password dialog using Delphi 2010

I want to create a Login/Password dialog which will prompt when someone click a specific button in my Delphi project. If the criteria entered are correct the user can proceed and open the form, the button opens. If not the button must not open the form.
For example my MainForm starts with 2 buttons. Both Buttons, when clicked, open a different form. I want to implement the Login/Password function to one of these buttons.
I use Delphi 2010.
You can make a login-function to which you also pass a TForm variable that has to be opened when login is correct. Or you can have the forms check if the user is logged in when they are opened.
There are many different approaches to this problem, you will have to decide for yourself which method is the best for your situation. Did you already try something that we can comment on?
The operating system provides such services, namely CredUIPromptForCredentials for XP, and CredUIPromptForWindowsCredentials for Vista and up. The JEDI libraries expose this through the JwaWinCred.pas unit.
These don't look like being the easiest API functions to call, but they do have the obvious benefit of being system native and so should give a good look and feel.

Resources