Selecting the text of a selected option of a Select - react-select

After looking at react-select code, experimenting a bit, and checking several examples, like: https://jedwatson.github.io/react-select/
It appears to me that once you select an option from the drop down, you can edit from scratch it by entering a new value, but you cannot select the current value the mouse (for example, to copy paste it, or to slightly modify it instead of writing from scratch).
Is these a way (e.g. a property) that I can use so that once I give focus to the Select element current value, the value itself becomes editable in the input element?
Thanks

Related

Automation Anywhere. How do I pick a value from dropdown

Automation Anywhere. How do I pick a value from dropdown. I tried 'set text' from a copied variable. Its very slow, and also doesnt seem to be the right away. I would want to pick a value from the dropdown. Any idea how this can be done ? Thank you
You can use Object Cloning for this.
The process will be like:
Select object cloning and select the window you want to clone.
Capture the object to which you want to select from the drop-down.
Object cloning intelligence will automatically treat this as Drop down, and an extra option like "select Item by text" will appear in the action list. Select that option.
It will only suggest the all the drop down options. Select the required option you want.
Press Save.
That's it.
Thanks
You can do it using 'Manage Windows Controls' AA Command ( in this command make sure you check available checkbox for Capture a control of specific type [select - Drop Down] in next text box) and capture the value from pick list.

How to set value in the textblock based on other textboxes and query in Access?

Right now I have such form:
The aim, that I'm trying to reach, is to open another form based on block_id value by pressing button. And it works. But block_id value in textblock should be based on three other values in the form: N_table, target_table and source_table. In the attached picture can be seen block_id's textblock form options. Source values for that textblock is query with name s2, and I tried to limit block_id value by setting filter here this way:
([s2].[N_table]=[Form1].[Список0]) AND
([s2].[target_table]=[Form1].[Список2]) AND
([s2].[source_table]=[Form1].[Список4])
There s2 is the query name, Form1 is the name of current form, Список0 and so on is the just list of values for first 3 textboxes. However that doesn't work at all. So block_id is independent. That is wrong here and how it can be fixed?
PS I'm really sorry for not english language in the attached picture, I can't change the language. And I tried to deal with the problem by using Event Processing macros but failed.
I can't read your language, but it looks if the FilterOnLoad property is set to No. Change it to yes, then it should work.

QTP - Clicking on a button with a given value

I've started using QTP last weekend so I'm still a bit confused about some things.
I've coded a function that opens an URL on IE, performs some actions and writes a report. But I have a little problem: at a certain point the function has to click on a button to go on but this button's value is changed at every refresh of the page.
For example: at the first access the button's value (or label) is "Results List (51)" but, if I refresh the page, the value becomes "Results List (11)".
What changes is the number inside the brackets (that identifies the number of results inside the list).
Obviously I recorded the action only one time and the result is this:
Browser("myBrowser").Page("myPage").Frame("myFrame").WebButton("Results List 51)").Click
How can I click on the button without having to worry about it's value?
You should open the object repository and have a look at the description that was create for your WebButton then make the property in question a regular expression.
In your case the value should be Results List \(\d+\), this means Result List followed by open-parentheses, followd by one or more digits (a number) followed by close-parentheses.
Here's an explanation on how to use regular expressions in UFT.
This question reminded me of the days when I was a beginner in QTP ;) I think I still am!
Coming to your question -
If you don't really care about what is inside the brackets then you can just give Results List*.* but if you want to check if there is a bracket and digits within it then use the value suggested by Motti i.e. Results List (\d+)
Detailed Steps as you are a rookie:
1) Go to Resources->Object Repository
OR
In the Resources pane expand your action and double-Click the local object repository (You recorded hence the objects will be in local)
2) Click on the Concerned Object so that the object properties specific to this object is displayed.
3) Select the property (name?), at the extreme right you will see a button to configure the value, click on it.
4) Type the text Results List (\d+) or Results List*.*, select the checkbox for regular expressions.
5) A message box will appear, Click on No and then OK button.
Your script should run now!

Find the difference (text)

I need a way to run a sub every time that text is added to a richtextbox. There is a changed event, but I have to know exactly what was added and at what position (even as trivial as a single space). I was going to do 'onKeyUp' but if users press CTRL + V, instead of getting the inserted content, I'll end up with just a 'v'.
Is there a way to do this? I need to be able to get the position that the content was added at and what was added. I'm doing this in VB.net.
I want to basically do something similar to http://typewith.me/
Let me show an example of what I want:
TEXT 1:
This is a message, currently no changes have been performed.
TEXT 2:
This is a message, currently none changes have been performed.
OUTPUT:
'ne' added at index position 31.
Cheers!
This might not be the most elegant solution, but the first thing that springs to mind is to store the contents of the text box in a variable. Every time it's changed, check the new contents of the text box against the stored contents and do whatever you need to, then store it again. This handles typing, pasting, deleting, etc.

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.