How to cancel any changes to textbox data - asp.net

I'm creating my own version of a wizard form using Asp.Net Webforms.
The form contains multiple steps and each step contains multiple input fields of varying types. Data is validated after each step is completed before moving onto the next step.
In addition to moving forward, each completed section also has an Edit facility.
I was hoping to have 2 buttons available in Edit mode - one to Continue and re-validate and another to Cancel and forget everything.
However, it seems that isn't so easy.
The continue button works exactly as the Continue button in add mode - in fact it's the same button - so no issues there.
But there is an issue with the Cancel button.
Suppose a user enters edit mode and changes their name from 'John' to 'Jon'. They could press Continue to accept and revalidate. however, if they were to press Cancel, they would expect so see the original spelling of 'John' restored.
This doesn't happen automatically.
So, as I currently see it, I have two options. The easy option - remove the Cancel button (and potential confusion) - or the hard option, to code a backup and restore solution in edit mode, which is likely to be a pain as it will need to cover all input types.
However, I'm hoping there's a third option available - one that offers some kind of built in functionality to help manage this problem.
So that's the question - is there any other solution aside from the two options I've already outlined?

Related

When to use wait.until in Appium?

I just started developing a test automation for an iOS app using Appium. I have to click several buttons in the app one after another with different XPath/Accessability ids.
I wondered, when to use the wait.until(ExpectedConditions.visibilityOf Element) expression.
Example:
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//XCUIElementTypeApplication[#name=\"app\"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeTabBar/XCUIElementTypeButton[3]")));
Should I check every time before I click a button if this button is actually visible or existing on the current state of the app or is this just unnecessary and time-wasting?
In my opinion, you should use ExpectedConditions in two case:
Screen load takes long, so you not ending up trying to click something that has not loaded yet. If you find your tests flaky (sometimes pass some times fails) then this probably the main reason why it happens
If you have something like ajax on your screen you want to make sure the data is changed on the page. (Example is you created a post on Facebook, and want to make sure content displayed)

How to signalize a customer to click at one button twice?

First I want to make clear that my problem is not a technical question. I want to talk about usability.
In my company we have a function to check if a scale works properly. We have the button you see bellow (1) to start a function named scaleCheck(). During the scale check the weight of the scale is set to 0 and then a specified weight is put on the scale automatically and when the weight matches the number set in a config file the scale is OK. So when you click on the button, it gets the white border (2) and when the check is finished the button turns normal again (3).
This is the automatic process, but not every customer has a scale which can put automatically a weight on it. So in this case the customer has to go to the scale an put a weight on it by his own. In our application the customer can configure, if he wants the process to be manual or automatic and the button will adjust to this. So when the configuration is set on manual we have to interrupt our function an wait for the customer until he is ready. Because we don't know how many time he will need, he has to click on the button again to tell the application that the process can continue. Therefore we changed the button a bit when we are in manual mode. As you can see below the button (1) changes the image, when the customer clicks the first time on it (2), to show that the weight has to be put on the scale. When he clicks the second time the process proceeds (3).
So this is the current state. The automatic mode works how the customers imagine it to be, but in the manual mode many people have problems with it and need a lot of time the recognize that they have to click on the same button again they clicked before.
And here is my question, is there a better way to show the customers that this button should be clicked again. Are there some people who have experiences with a similar kind of functionality? Or is there a better way to do it? I'm open for every idea which comes in.
We ended up with the opinion that it is not a intuitive solution to click twice on the button. We solved it by showing the user a message after the first click on the button, and accepting that message is count as the second click. With usability in mind this i by far a better solution and the customers can handle this situation much better.

Should WP7 edit forms have Save/Cancel buttons or should you use 2 way binding?

This is a question on edit form UI for a WP7 app:
I currently have my edit form fields set to 2-way binding which means that as the user changes them they save on edit and update the UI in the ViewModel (Method 1). So I don't need a Save button and there is no Cancel button (unless you code in logic to store the original state and rollback on cancel).
Method 2 would be to use 1 way binding and UpdateSource on the save button and then you could have a Cancel button which functions like the Back button (goes back without saving).
Method 1 is nice as it handles preservation of state if the app is tombstoned - WP7 will restore the page and your changes will have been saved. The downside is that there is no way for the user to restore it to it's starting state once they make changes. My form is trivial so I do not think this is a problem. The Back button acts as Go Back.
I also do calculations in the setter property in my VM that need to be reflected to the UI (ie you will in Field 1 and Field 2 is double the value (but they can also override it) - I use 2 way binding on Field 1 and update field 1 and 2 on edit. I can't think of a way to do this using explicit updating.
The problem is that I have a Delete button for the record, so when I use Method 1 with no Save and Cancel button the user is likely to click the Delete button as it is the only available option (they need to click on the Back button to go back).
My question is; should a simple form have a Save and Cancel button and commit the data only on Save, or is it ok to use 2 way binding and have no buttons?
Parts of this are mentioned in the UI Design and Interaction Guide page 68.
Changes to Application Settings should be immediately implemented. This
means that a “Done”, “OK”, or other confirming dialog is not needed.
...
If a task cannot be undone, always provide the user with an option to cancel. Text entry is an example.
Actions that overwrite or delete data, or are irreversable must have a “Cancel” button.
As for your situation you will need a confirmation for the delete action (see the ie settings for an example). For your other fields check the guide as other issues are mentioned and you could also see how the built-in settings work.
If it is possible that the user may ever not want to have their entered text changed it'll be easier to have a one-way binding and update the saved value only when the user specifically says to.
Yes, this can make the preservation of entered data slightly harder during tombstoning but means that it's easier fro the user to be able to change their mind.
In your situation, I'd recommend having on screen buttons for Save and Delete (and relying on the hardward back button for cancel).

Issues with using # for deep linking into dynamic apps?

I have a Flex app I built. It uses the BrowserManager class to listen for changes in the # part of the URL. When a change is made to the hash my application updates accordingly so you can link directly to a state of the application. Also inside my programming when a user clicks something, all I do is use the BrowserManager to update the # and then my listener will apply the correct changes once its finished. I believe this is the best practice way to doing this in Flex.
I have some issues though. When using the Back button in FF or IE, it gets "stuck". for example if the hash is like #state4 clicking the back button will take you to #state3 then #state2 but sometimes get stuck where you can be on #state3 click the back button, see it flicker to #state2 real quick then change back to #state3 preventing you from going back any further in your history.
Now in Chrome its even worse. As you make your way through the application the hash # is updated and so the application updates (proving that the app can see changes in the hash since thats the only way it updates). but when you click the back button, the hash # goes back to its previous state, but my application does not as if it is unaware the hash is changing.
I find this very bizarre and don't know what to make of it. I was wondering if anyone else had experienced this or knows what might be the issue.
To see it in action go here and navigate the builder (it will ask you to click jewelry type, metal, etc.) a few times until you see the big red add to cart button, then try to use your back button to get back to this page.
Have you tried the History Manager. Have a look on the http://www.nbilyk.com/blog/1/68/flex-history-manager

How can I disable an individual item in a combo box in Flex so that it is not clickable?

I want to create a combobox in flex which will take three values, Available, Unavailable, and Busy. The constraint is, I should not allow user to go directly from Unavailable to Busy. So when a User is selected Unavailable, I should keep the Busy item disabled (unselectable), but a user will be able to go directly from Available to Busy. I chouldn't find a straight forward way to disable an item in combobox in Flex. How can I do that?
Have you considered using radio buttons rather than a combo box? It's clear how to do this for radio buttons, for one thing. Also, it can often be friendlier to present the available options without requiring a click to reveal them. (Especially if, as in this case, you are adding the possibility that an option is "available, but not possible for you right now for some reason not shown in this combo-box item").
If you really want a combo-box, you can use the click event to display it in a non-standard fashion by probably changing its style; and then, if clicked anyway, Then, in the selected event, reject the choice (hopefully with an indication of why),
Or, if you want to simply remove it from the list, you can have the click listener event repopulate the source list each time, based on conditions. But that might be confusing to the user, too.
You can also have a look at
www.stoimen.com/blog/2009/03/05/flex-3-combobox-disabled-options/
which references
wmcai.blog.163.com/blog/static/4802420088945053961/
(note for NoScript users you must have 163.com and 126.com at least temporarily allowed to be
able to properly see this page)
it works very well even though I added the code for being able to properly handle keyboard
events in the dropdown list
Full self working example available at
http://olivierbourdon.homedns.org/OpenSource/combos.zip
Thanks again for the good work

Resources