Textbox using Exit and Command Button not clicking only gets selected - button

First time posting. I'm having an issue, I wrote a simple VBA Userform with a textbox and command button that changes color when clicked.
My textbox command...
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Sheets("Sheet1").Range("A1") = TextBox1.Text
End Sub
I use Exit instead of Change cause change slows down the excel program.
Private Sub TextBox1_Change()
Sheets("Sheet1").Range("A1") = TextBox1.Text
End Sub
The problem is after typing and mouse clicking the command button,
the command button gets selected and does not click and change its color. Somehow using Exit instead of change the mouse click does not click the command button.
Could anyone please help me with this issue its frustrating.
Thank you a lot.

Related

Atom editor end of line shortcut (without end button)

In my laptop keyboard I can move cursor to end of line by pressing FN + right arrow buttons.
Now I am coding on a desktop and this keyboard doesn't have that combination.
I can move cursor to end of line by pressing "END" button but I don't want to use END button I just want to add this functionality to a similar combination what I had in my other keyboard.
So I am looking a way to create shotcut to press ALT + Right Arrow to make same functionality as END button. Is there any way to do that ?
Thanks.
After reading all documentation and making some tries I found out how to move cursor end of the line.
First go to File -> Keymap this will open keymap.cson file on here just add codes under 'atom-text-editor'. It will look like as below.
'atom-text-editor':
'alt-right': 'editor:move-to-end-of-line'
'alt-left': 'editor:move-to-beginning-of-line'
So now you can move your cursor end of line by pressing ALT + Right or visa versa.

SAP Table Control with button event

I have inserted button to table control, I am calling one more screen on the click of this button.
I need the line number of table control when I press this button.
Try this method;
https://archive.sap.com/discussions/thread/1581196
GET CURSOR LINE li_line.
This should return the line that triggered the push event.

Need help troubleshooting button click in Selenium

Update:
After further investigation, actually what's happening is when the checkbox is checked using jquery, the next step is to click the button to save. Well, for some unknown reason, the checkbox is unchecking itself.
Here's the jquery to select the checkbox:
string jsStmt = #"
$(function(){
$(':checkbox').filter(function(){
return $(this).parent().next('td').text() === 'Label to look for';
}).prop('checked', true);
});
";
IJavaScriptExecutor js = (IJavaScriptExecutor)_driver;
js.ExecuteScript(jsStmt);
I can see the checkbox get checked, then when the dialog closes I can see it get unchecked?
OP:
Button click event for Selenium testing has been working for a while. All of a sudden, it's not working anymore. Only possible change was some 3rd party css change but I don't know what it could've been.
The button is kind of buried in layers, however, there's a checkbox that gets checked by Selenium that is still working fine, and it's the reason why the button needs to be clicked.
I can debug, and see that Selenium is finding the button. It appears that the button gets clicked but the postback event doesn't occur.
I can stop execution right before the click event and open developer tools and manually type in the statement to click the button, AND that works!
I even tried executing the click with JavaScriptExecutor with no luck.
I am so lost why it's Not firing postback event.
In short, try clicking the checkbox using an IWebElement instead of javascript.
I would suggest avoiding using IJavaScriptExecutor as much as possible in selenium tests as it can lead to performing functions the user wouldn't actually be able to do with simple interactions, or having those functions behave differently than you would expect because the execution path is different than what a user would do if they just clicked something.
I think that's what you're running to in this case where you're trying to mark the box as checked.

Flex focusOut event on TextInput and pop-up does not remove focus?

I have a flex app with several fields and one text field with a focusOut event:
<mx:FormItem label="Last" x="226" y="1">
<s:TextInput id="lastNameClientTextInput" text="#{_currentEditClient.lastName}" change="textFieldChangeCapitalize(event)" focusOut="lastNameClientTextInput_focusOutHandler(event)"/>
</mx:FormItem>
As expected, when I tab or click out of the field after typing a value it executes my "lastNameClientTextInput_focusOutHandler" method which simply pops-up a new window:
protected function lastNameClientTextInput_focusOutHandler(event:FocusEvent):void
{
clientSearchPopUp = new ClientListWindow();
PopUpManager.addPopUp(clientSearchPopUp, this, true);
PopUpManager.centerPopUp(clientSearchPopUp);
}
That window will do a "PopUpManager.removePopUp(this);" when the user clicks the close button.
However, the problem is when the window closes, the focus is back on the lastNameClientTextInput! I am unable to click or tab out of the field!
When I tab out I do initially see the ibeam cursor move from the last name field to the next field in tab order (address) and then my window pops-up. When I close the window it moves BACK to the last name field and highlights the value.
It is as if I need to do something to validate the focusOut event?
You might want to try using valueCommit rather than focusOut. You could also listen for the popup being removed and set focus manually.
HTH;
Amy
Late I know, but Flex may be referring to the FocusManager.lastFocus property to resume focus from the last time the component was active. When triggering the pop up, try calling:
(focusManager as FocusManager).mx_internal::lastFocus = null;

Editing row of a datagrid in ASP.Net VB.Net

I'm working on a piece of code at the moment that uses an older style DataGrid to allow the user to enter information into the table. It already has an add and delete button. Currently the user enters information into 3 textboxes that are in the footer, and the other rows use labels to display the information.
Essentially what I am wanting to do is take the line that the user has clicked the edit button on, and move the text from there in to the footer (deleteing the row that it was displayed on) so the user can make changes and then click the add button again. At the moment I have tried using FindControls to find the textbox and setting the text that way but it doesnt like it. Any ideas?
A few things need to be clarified - are you referring to the older .NET "DataGrid" control or the newer "GridView" control. Also, is this a web or winforms app?
My suggestions -
Have you tried to programmatically add and set the TextBox controls by handling the GridView1_RowEditing event?
To remove the row that's been edited - remove it from the datasource and rebind the grid.
list.Remove(itemToRemove);
GridView1.DataSource = list;
GridView1.DataBind();
Then, take the data from itemToRemove and use it to programmatically create and set textboxes in the footer.
If the third column of your data grid is called "Name" and contains the name data, you would create and set the third column's footer row TextBox value like this -
GridView1.FooterRow.Cells[2].Controls.Add(new TextBox { ID = "tbName", Text = item.Name });
How are you using FindControl? It always helps to post your code ;)
You should be able to execute a FindControl() on the footer row and get the textboxes with no problem.
GridViewRow row = GridView1.FooterRow;
TextBox txt1 = ((TextBox)row.FindControl,"TextBox1"));
Essentially I changed what I had originally planned. Instead of moving the text from the row to the footer textboxes and deleting the row I instead used the EditCommandColumn to create a link button like so
<asp:EditCommandColumn ButtonType="LinkButton" ItemStyle-ForeColor="Blue" EditText='[edit]' UpdateText='[update]' CancelText='[cancel]'></asp:EditCommandColumn>
I also had to add EditItemTemplate to each column, with a textbox in each, and bind the data to the textboxes in the same way that it was bound to the labels in the ItemTemplates.
Then using the ItemCommand event handler I added some code behind to set the EditItemIndex to the row that was being edited.
Private Sub GoodsList_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgdGoods.ItemCommand
Select Case e.CommandName
Case "Edit"
dgdGoods.EditItemIndex = e.Item.ItemIndex
Case "Cancel"
dgdGoods.EditItemIndex = -1
Case "Update"
dgdGoods.EditItemIndex = -1
'Update details here
Then, at the end of this rebind the data to the datagrid. With the EditCommandColumn it will automatically change from displaying the Edit button to showing the Update and Cancel buttons on the line that is being edited.

Resources