I have an interesting issue with a LightSwitch app I am maintaining, there is room for confusion so will try and explain at length and answer any clarifying questions.
I have a LightSwitch AddEdit screen using the default 'Flip Switch' control for Boolean values in a table, set to Yes/No Option (so shows Yes or No as values, actually saves 0 or 1), when creating a new entry, the control shows 'No' by default. The issue is that depending on what permission the user has the control behaves differently, either:
1) the expected/desired behaviour: The flip switch is set to 'No' by default and if the screen is saved without touching it 'No' is saved to the database (What the user sees and what is saved is consistent, a flip switch is never NULL).
2) The unexpected behaviour: The flip switch looks like it is set to 'No', but when user attempts to save the screen, gets a warning "Error: Cannot continue. There are validation errors on the page" because there are Boolean values that do not allow NULL (the relevant flip switches are highlighted with 'This field is required') the user can toggle the flip switch control to Yes and back to No, at which point the screen will save (touching the control seems to set it to a value from NULL), but disturbingly the other flip switches that do allow NULL are saved as NULL instead of the 'No' they show on the screen, this is confusing and problematic and will require users to re-enter all the NULL entries once I fix this bug.
The troubleshooting I had done so far shows that the behaviour is contingent on what LightSwitch Access Control permission the user has set, if they are in one group(SystemAdministrator) they get behaviour 1 in another(DatabaseOperators) they get 2.
It also appears contingent on being an 'add' rather than an 'edit' if adding a new row as a SystemAdministrator, the data will be added as behaviour 1. if editing an existing entry you get behaviour 2 as both permissions.
I tested commenting out the VB code that filters the permissions for the data source for this table (TableName_CanRead, TableName_CanWrite, TableName_CanInsert, TableName_CanUpdate, TableName_CanDelete, TableName_CanExecute, TableName_Filter) as that seemed to be a likely point of difference and it did not change the behaviour.
I am hoping that someone more familiar with the LightSwitch environment will be able to point me to another likely place where this issue is coming from and give some hints on where to look or further troubleshooting steps.
I currently can't see how the permission group is effecting the flip switch control behaviour so markedly
The best practice for your scenario in my opinion is the following:
on the screen created code block, use the following code for each switch:
myapp.SCREENNAME.created = function (screen) {
if (screen.TABLENAME.theFlipSwitchA == null) {
screen.TABLENAME.theFlipSwitchA = false;
}
if (screen.TABLENAME.theFlipSwitchB == null) {
screen.TABLENAME.theFlipSwitchB = true;
}
}
This will ensure the null values are replaced with the correct TRUE or FALSE values at the start, and will only change if the user changes them.
In Addition
There are 2 views available for a flip switch aswell being Yes/No and On/Off, which can be accessed on the properties of the selected Flip Switch:
One thing to make sure is you use the Data Binding property to specify the value, not the Name like you usually would on a forms application for example.
I am planning to make a maths game there will be one question like 1+ 1 as an image in Javafx. The textbox provided will give the user to input the number how do for example for 1+1 just allow the user to put in 2 and for everything else it will not accept then number in the text box. and display a message try again or something similar.
Basicly how do I restrict the text box for a specific number
I am doing a registration system by using vb 6.0. I want for user to enter the mobile number. So I want the mobile number to be limited to 8 digits only. If the number is over 8 digits, when the user click save button, a message box will pop out to ask user to recheck the data again and it will not be save until the data is inserted correctly. What is the coding for me to do that?
Don't let your user enter more characters than allowed, then tell them later they can't do that. The TextBox control has a property you can access from the designer named MaxLength. Set that property to 8 to limit the use to a maximum of 8 characters. Better still would be to use the MaskedEditBox and use the Mask property to enter a mask that limits and formats the user input. To add a MaskEditBox you need to open the Components window and add the Microsoft Masked Edit Control 6.0 to your toolbox. You can then add the control to your form.
I would like to set up a view controller with a 2-component picker where each side contains the same 7 objects. Each object carries the same value for both components. The user would make a selection from each side, enter a value in a provided text field (and optionally tap a "Calculate" button). A calculation would occur using that value and the values from the two picker component objects that were selected and the results would be displayed in a label.
For example, each picker contains the letters a - g. Each letter carries the value of 1 - 7 respectively, for each side of the picker. The user selects "b" and "d" and enters 10. The calculated result of 10 * 2 / 4 = 5 is displayed.
It sounds simple enough. I've found tutorials for doing calculations using values associated with a 1-component picker as well as working with 2-component pickers, but nothing for doing calculations with 2-component pickers. My experience with Xcode is somewhat short. So, feel free to go into detail.
In the programming of a table-based application module (i.e. the user mostly enters tabular data in an already laid-out table), how would you reject user input for a given cell?
The scenario is: the user edits the cell, enters something (text, picture, ...) and you want them to notice when they finish editing (hitting enter, for example) that their entry is not valid for your given "format" (in the wider meaning: it can be that they entered a string instead of a number, that their entry is too long, too short, they include a picture while it's not acceptable, ...).
I can see two different things happening:
You can rather easily fit their entry into your format, and you do so, but you want them to notice it so they can change if your guess is not good enough (example: they entered "15.47" in a field that needs to be an integer, so your program makes it "15")
You cannot guess what to do with their entry, and want to inform them that it's not valid.
My question specifically is: what visual display can you offer to inform the user that his input is invalid? Is it preferable to refuse to leave the editing mode, or not?
The two things I can imagine are:
using colors (red background if invalid, yellow background for my case 1 above)
when you reject an input, do something like Apple does for password entry of user accounts: you make the cell "shaking" (i.e. oscillating left and right) for one second, and keep the focus/editing in their so they don't loose what they've typed.
Let's hear your suggestions.
PS: This question is, at least in my thought process, somehow a continuation and a specialization of my previous question on getting users to read error messages.
PPS: Made this community wiki, was that the right thing to do on this kind of question or not?
Be careful using autocorrection such as forcing user input to fit your format. See:
Is it acceptable to normalize text box content when it loses focus?.
It’s generally better to prevent invalid entries in the first place than to autocorrect them later. For example, if only integers are allowed, then you ignore any keying of the decimal point (along with all letters and most special characters). In some environments, you may want to provide a quiet audible signal that input is ignored (e.g., a dull thud).
As for when you need to alert the user to an error, how about a callout? Draw a bright line from the control or point in question (field, status annunciator, button, menu, location of a drag and drop) to the margin of the window and put a brief message (two or three words, like "Unrecognized date") in a balloon. Placing the message on the margin should keep it from occluding anything of interest in a crowded table.
The sudden appearance of the call-out should be sufficient to catch user attention, so it's okay to let the user move on to other cells in case they want to fix the error later. For efficiency, you may want to hold the user in the error-related field when the error originally occurs (since often the user wants to correct it right away), but then allow the next tab or mouse click to navigate the user away.
On mouseover or when focus is on the control associated with the error, the line is highlighted (to distinguish it from other callout lines that may be present) and the balloon expands to a full error message, providing more details on how to fix the problem (up to two sentences). Allow the user to drag and drop the balloon to a new location in case this occludes something of interest.
Include a Help button in the expanded balloon for further details. You can also include a button to fix the error (e.g., Retry, Reconnect, or set to default value).
The balloon disappears automatically when the error is fixed. Undo reverts whatever caused the error (e.g., reverts the field to its original value), which should clear the error.
If the user scrolls away from the place associated with the error, the balloon shrinks to an icon that remains in view so that the user is less likely to forget about it. Maybe an exclamation point in a triangle is a good icon. Place the icon beside or in the scrollbar track to indicate its relative location in the table, so the user can quickly scroll to find it later. Mouseover expands the icon to its full message. Perhaps clicking the icon can scroll to the right place in the table and put focus in the relevant control.
Balloons could also shrink to icons if they start visually interfering with each other. You may even want to include a control in a balloon to allow the user to force it to assume an icon.
For consistency, use for all errors, not just those associated with fields in tables.
The last time I did such a form (on a web page) I put a red box around the offending input.
I thought it was really neat... until a user asked me "Why's there a red box around this cell?"
What'd be nice is also displaying why the input's incorrect: "This field accepts only numbers", say.
You could display an icon in the cell, or a tooltip. The tooltip could open automatically or when mouse pointer hovers over the icon. It could disappear automatically when user edits another cell or when some timeout expires.
You can go with arrow tooltips like Adobe Flex's error tooltips. It focuses the attention to the error and supplies a brief description.