Should WP7 edit forms have Save/Cancel buttons or should you use 2 way binding? - data-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).

Related

How to cancel any changes to textbox data

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?

LiveCycle ES 2.5 Aws_Action field JavaScript

I have a form that I am designing in Adobe LiveCycle ES 2.5 for a client.
Quick background for the project: It involves taking an even older PDF and converting it to allow digital signatures with potential Reject/Accept buttons.
Does anyone know how to determine in the click event (AWS_SUBMIT::click) for the submit button which submit button was actually clicked??
Like the Reject vs Accept button.
The client only has access to Adobe LiveCycle es2.5 workbench/suite.
The AWS_ACTION field's raw value contains the caption of the button that was clicked, but not until it has been clicked - before that, the rawvalue is null. You can put code in the AWS_SUBMIT button click event to do various things based on the value of AWS_ACTION. I have used it before to do different validation depending on the action taken, eg, if the form is rejected, check that they have entered a comment before allowing it to submit, etc.
The possible values for AWS_ACTION match up with the list of user action names you set in that process task in Workbench.

Use Page Items in a Button Link in Apex Express

i have a little problem. I'm using Oracle Applicarion Express and i'm trying to use some page items in a Link created for a button. I created the Button as region button, and selected in the region" Action when button clicked" "Redirect to URL". In this URL i want to use two pageitems. I tried already to use them mit ":PAGE_ITEM" or "&PAGE_ITEM." but non way works. Can someone help me please?
What does the resulting hyperlink look like? The chance is great that it looks like
f?p=<app_id>:10:<session id>::::P10_ITEM1,P10_ITEM2:,
This is because when using the substitution syntax like &PAGE_ITEM. will put the session state of the referenced item in the string. Since the button is rendered during the loading of the page it will use the session state of the item at that time.
When you then fill in a value for PAGE_ITEM, this will not change the session state of that item - and even if it did it would not matter since the button was already rendered.
If this is the case then you'd better have the button submit the page, and define an on submit before validations/computations branch to act on that button. In the branch you can then safely use the session state of the required items.

Show alert if moving on without saving in Flex?

Functionnaly :
On one of my components of my application, I have an editing/lock system. When a user starts editing, he locks the file so other users cannot edit it.
Problem scenario : When the user activates "edition mode" and leaves screen, I would like to show a alert with two options : save changes, or discard changes.
There are different ways to exit screen :
There is a List on the left side containing other possible editabel data. A click changes the data in my component.
There is a menubar on top leading to other screens.
The edition component is embedded in a Tab navigator. When changing tabs, the alert has to show.
Closing browser.
Do I have to catch all of these events and plug at all those places?
Is there any kind of focusout mecanism?
The answer to the first question is: YES.
You need to watch all possible exit events that could harm the currently edited data.
Well, the problem is now how to manage this properly. Using an MVC framework you would trigger the appropriate commands from your components:
CHANGE_LIST_ITEM (new item)
CHANGE_TAB (new tab)
CHANGE_SCREEN (new screen)
Each command then checks if the currently edited tab has been saved or not. If not, it displays the Alert. Else, if there are no changes, it allows the list, the screen chooser and the tab bar to continue.
So your components (list, screens, tabs) need to implement some kind of rollback or preventDefault mechanism. Generally, changing their state must be allowed by a central validator (in MVC the command).
In the case of the list: I would suggest that the list is not selectable by mouse click but only programmatically. You set a listener on the list item click event. If the command allows setting of a new item it will notify the list. In MVC usually by sending an async message that gets received by the list's mediator. [[And even more correct: The command would set some model properties (e.g. currentListItem) and the model than sends an async message.]]
Edit: For the browser close event, you need to call a JavaScript expert.

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