Ionic-Vue hot reload clears out state? - vue.js

I'm trying to use Ionic-Vue to develop a mobile application. My problem is summarized by two examples. I apologize if I think including any code to illustrate the problem isn't necessary.
Case 1:
I tried making a form which contains say a Log In. I enter data to the input box and then change the submit button text value in code and save it. The page clears out the data in the form which I don't expect.
Case 2:
I tried making a counter that starts from 0 which increments with successive Count Up button presses. However, if I change the button text value of the counter button to Count Up by 1, the counter value resets back to 0 - a behavior which I don't expect.
How to solve this?

Related

VBA clicking buttons in loop

I'm using VBA + Selenium to export data.
Work sequence is as below
enter specific numbers input box
Click button
Sel.FindElementByXPath("//tbody/tr[2]/td[6]/button[1]/em[1]").Click
Export data
Above works should be in loop until the end.
Problem is that sometimes number of click buttons can be different.
How can i make VBA to click the button until the end?
FYI, I found the rule that "tr[2]" changes like first one is tr[2] and second one is tr[3].
//tbody/tr[2]/td[6]/button[1]/em[1]

How to design EVM machine in LabVIEW software

I had an problem regarding design of EVM machine.
Once the button is pressed a vote must be counted. So for that a counter is needed how to create that?
Without knowing more about your project, I'd use a WHILE loop with an EVENT Structure. The Event Structure waits for a Value Change event on the button. On a change of a button, the corresponding value in the shift register is increased by 1 and displayed.
The snippet is missing the initialization of the indicators, since they are updated on the first click, only.

How to know if a user has stopped their selection in a datagridview?

My scenario: I have a datagridview and it contains some data. User can select a row, or multiple rows in that datagridview, and they need to know a summary about those rows they selected.
Handling multiple rows in datagridview is easy enough, and I have no problem getting what the user need: Two numbers indicate how many item is selected, and their total weight in those rows. I passed that data to a small summary form to display, and I put the code to show that form under dgv.SelectionChange().
But then disaster follow: each time user select a row, that form will appear. Which is, if user select 20 rows, they will see 20 summary forms.... and any more than that, well.. you can imagine. I thought about putting something inside SelectionChange() to check if user has stopped their selection.. but can't think of any.
This seems like a very simple matter, but somehow I can't figure it out..
My question, how to know if a user has stopped their selection in a datagridview ?
I still don't have enough points to just comment, so my answer would be I don't think you can reliably without adding another control (ie, button). You can't read the users mind and since the number of rows can be variable, how would you ever know? You could try something like if the cursor leaves the DGV but that would be frought with issues as well. While it would be an extra click for those just selecting 1 row, I still think having a "Get Summary" button would be the way to go. Sort of like when selecting items to compare - you can click any number of items and while they may show which items you've picked so far in another area, the comparison table doesn't appear until you click the Compare button.
From what I understand, you actually have two options.
Add a button
Since you can't figure out when the selection is done, just add a button that will call the Form you want to display, that way you are sure that it will display only when user asks for it.
Use a timer
Another option is to use a Timer, every time the selection changed, you reset the timer to one second (to keep the example simple).
And whenever the timer does a tick, you call the Form and stop the timer. That way it will trigger one second (or less) after the user made the selection and gives him one second to change it...
Honnestly, I think the button option is the best, as you give the power to your user. Maybe they will want to select some rows but don't want to see your form, as they will only copy it to paste it somewhere else...

Appium for iOS: How to verify attributes that changes instantly

I have a button which has only attribute "value" that changes from null to 1 when it is clicked. But within a fraction of time it restored to value null . During that fraction of time it gets highlighted.
I am retrieving the attribute value and asserting that it is "1" to verify that it is getting selected when tapped on it. But the time when my next command fetches value attribute , it restored to null.
Any work around for this ? Any way to stop appium to load page source after execution of a command or fetching the value attribute at the same time/instantly while clicking the button?
Not that I know of. Maybe your developer could do something for you like value==1 means Clicked, value < 0 means Not Clicked, so on each click it temporarily goes to 1, then to -2, -3, -4...? Or maybe another element on the screen could change when it is clicked, signaling that the button was clicked. Not an elegant solution, I know. Such is automation.

Detecting last value of database after refresh the application

I am making an iPad app. I have got some problem. Actually I want to show one view at the starting of the app after launching of splash screen. I have made one checkbox on it. It will work as on/off button. Very first time launching of the app, this screen will show to the user. If user click the off button then this screen will never show to him even after refresfing the app. For it, I have made a database table in which at the starting I have stored 0 value in it. When user click button then it becomes 1. But whenever user will refresh the app it becomes again zero but I want to retrieve the last value from the database. Anyone has idea that how to retrieve last value from database table even after refreshing the app.
Thanks to all.
You really should use user defaults for this purpose. There is a method, registerDefaults that is used to set initial values for a default, but once the user has changed it, that initial value isn't used again on subsequent launches of the app