i've a form with 2 text box (RealEdit): one field is bounded to a table field.. another one is simply a text box not bounded.
How to copy the value from the first to the second text box ?
set autodeclare propoertie of the second field to true.
then in your code do
mySecondField.value(myTable.firstField)
where myTable.firstField is the field bound to the first control (not the first control him self)
Related
I'm looking for a way to default a cell value with data validation applied, but allow the user to overwrite the value to one of the valid values allowed.
I have a demo spreadsheet here.
And visually:
I have data validation on column D that provides a list of possible markup percentages from column G, however, I want a default value in there so I have written a formula to work this out (based on there being a value in an adjacent cost cell).
I enter the item, I enter a cost and the markup defaults. All good.
But, when I click the dropdown I don't get any values popup. the formula is shown instead.
I have tried conditional formatting based on making the cell text and background white, but this is sub-optimal for my real world (significantly more complex) scenario.
How can I achieve what I am after - a default value of 50% if there is a cost value, but selectable from the drop-down.
The only way to add a "default" value based on a condition is to use on edit (simple or installable) script.
Example:
The following is an simple on edit trigger. If a cell from column C below the first row is edited, then the cell to the right will be 50% (assuming that the cell format is set to display %)
function onEdit(e){
if(e.range.columnStart === 3 && e.range.rowStart > 1){
e.range.offset(0,1).setValue(0.5);
}
}
Resources
https://developers.google.com/apps-script/guides/sheets
https://developers.google.com/apps-script/guides/triggers
Suppose I have a numeric field in an edit box, with a valid range of 2.0 - 13.0. The field is bound to a numeric value V in my program, as is a slider, so changes in the field will update V and the slider position, and changes in the slider position will update V and the numeric field content.
What should be the behavior of the field content when a user presses the Backspace key in these situations?
2.03
2.0
2.
2
???? what should the field contain
and
10.7
10.
10
???? what should the field contain
The unvalidated field content of (blank) and 1 are not valid. Should the field correct its content to lie within the valid range? Should it allow text content to be invalid but somehow indicate that invalid-ness?
The text content should be marked as invalid. The slider should remain at the latest valid position. This would be the least surprising behaviour.
A text field correcting its content would most probably confuse the user.
I need to open a second form and position it in a particular location on the first form opened.
Explain: I added a panel to the original form and as I was putting controls on it, I got a message that I could not add any more controls. So...
There is an existing panel that I need to cover up with a second form and have it remain covered even if the original form is dragged about the screen. The second form will cover it, but I need to know how to position it in reference to the first form.
The only references I can find are how to position it on the screen, not another form.
There's certainly no easy way to do that (a form can't host another form). The limit you encountered was the max number of named controls you can have on a form (254, see https://msdn.microsoft.com/en-us/library/aa240865(v=VS.60).aspx).
However, a control array only counts once to that limit. So instead of adding a new control (for instance text boxes) for every input field, add them as new elements of a text box array. The difference in code is that you'll reference the text boxes by index instead of unique name (you can use constants as index parameters to identify the different input fields, such as name, address, etc).
I want to use <p:focus> in two ways:
1. Move to the input field if that field fails validation, i.e. is required
2. If on a page that has an input field that is visible when the page loads then move to that field. But if the page has a lot of introduction text and the input field is way down the page then don't move to the field as the user has to then scroll up to read the start of the page.
How can I have both cases handled? It seems that if I have <p:focus> I cannot avoid the page scrolling automatically way down the page if the first input field is there but I also want to move to the required field if a value has not been given.
Thanks
First, don't use the attribut for to select the default focused element.
Second, you only have to update your p:focus, and it will automatically select the first field where error occured.
For 1: See the answer above or http://www.primefaces.org/showcase/ui/misc/focus.xhtml
For 2: The only solution I know of that can achieve this is to not use the <p:focus/> and implement your own focus code (not to difficult). Detect the position of the first input and if it is far down, don't 'focus' it.
I am new to oracle adf in my application one of the field is id and it is sequence generated value Whenever I entered remaining values and click on save then only it has to display with sequence generated value before saving it has to be in hide mode. Can any one help me how the approach is.
set visible property for seq field. like below
visible="#{binding.filedName.inputValue != null}"
by default seq field value is null so it will not display. once u click save button, this field value to be set to next seq value so it will display
Just remove this value from UI and do your number generation for this field in model.
You can set the visible attribute of the field in your page to be based on an expression language such as #{viewScope.showfield}, then add a setPropertyListener to your save button that sets the #{viewScope.showfield} to true.