Orbeon: reset value of hidden field - forms

I have an autocomplete field and radio buttons which have a visibility condition, is there any possible way to reset their value when the visibility condition is false оr to somehow get information about the visibility of those fields (something similar to /text() or /#label)?

Related

How to set an empty initial value for Flutter Slider?

Currently the "value" property of Slider is required, however I was wondering if it is possible to create a Slider such that it initially has no value and the thumb is hidden. Then when the user presses along the line, the thumb appears at that point.
I looked at https://pub.dev/packages/flutter_xlider but it seems like that package also required values to be set.
I think not, and for good reason. The function of the Slider and the understanding of how it is used is interpreted by the user primarily based on seeing the thumb indicator on a line. So regardless how you set up the requirements for the slider's usage in your app, the Slider control needs to always have a value represented. You could default the slider value to the min, the max, the middle(-ish), or any valid value.
If you want to ensure the user makes a selection (making it a required field sort of), you could set a bool state variable on an ancestor widget (perhaps named sliderWasTouched) to true when any part of the Slider is tapped and whenever the Slider changes value (after initialization), and then make that state variable being true part of your form field validation.

Null Values in Checkbox Custom Fields

I'm noticing that editing a matter from the web interface and adding a checkbox custom field to the matter does not automatically set that checkbox to 'false.' Instead, unless you set the box to true, save it, and then re-edit it to uncheck that box, you cannot get a subsequent api call to return a 'false' value.
It strikes me that this ought to be corrected?
This is Matt G. from Clio's API support team.
You're correct that checkbox custom fields don't return a false value unless thy're actually toggled on and then off. Until some value is set, the checkbox field won't have any information stored in it and will return a null value.
We'll evaluate the functionality and look into updating how checkboxes work. In the meantime, if you want to get records of all Matters with an unchecked checkbox, you can look for Custom Field Values that are false and null.

React: Uncontrolled radio button input with value attribute throws warning

I've read through the React docs for forms, and I understand that an <input> element with a value attribute will create a controlled input. However, for a radio button or checkbox, shouldn't the input only be controlled if it has a checked attribute, and ignore the existence of a value attribute?
Typically the value attribute of a radio button or checkbox is not representative of its state, but rather of the value that should be passed back to the server.
I'm getting an error suggesting that the docs are correct and that you can't put a value attribute on an uncontrolled radio button input. The JSFiddle here shows the error I'm getting in the console when I click on the radio buttons:
Warning: Form is changing a uncontrolled input of type radio to be
controlled. Input elements should not switch from uncontrolled to
controlled (or vice versa). Decide between using a controlled or
uncontrolled input element for the lifetime of the component.
If I remove the value attributes from the inputs, the error no longer appears [JSFiddle].
So is there any way to include a value on an uncontrolled radio button (or checkbox) input with React?

Infopath: Rules with Multiple Selection List Box do not trigger

Im trying to implement several rules for a form, based on a selection of some multiple selection list boxes. Im customizing a form for a existing SharePoint list by clicking on "Customize Form" in SharePoint. First of all, the choice fields on the list (multiple selection) are oddly binded in InfoPath:
I cant change the variable's name "Value" and Real Estate Categories should not be a required field. (*)
On one view I have a "Business Unit Purchase" box that is a multiple selection box (choice) and there is a next button. The next button should only be availiable when a selection is made.
So I tried to the following rules for the Next Button:
Rule Type Action:
IF Value (of Business Unit Pruchase) is not blank -> Switch to next view
This works properly, but now i wanted to disable the next button when nothing is the text box was selected, because it makes it more clear to have a selection beofre ist possible to go on. So I tried this:
Rule Type Formatting:
IF Value is blank -> disable this control
This disables the button as wanted when the multiple text box has not any items selected, but after selecting one or more, nothing happens. Is there any reason why this does not work?
Normally when a selection is made, the field "value" of "Business Unit Purchase" should contain one or more strings and therefor should not be blank anymore.
A multiselect list box almost always contains one blank element entry unless it has been manually removed (e.g. via code).
Because of this, the condition Value is blank will almost always be true.
To remedy this, use the dropdown in the Condition builder's field selection dialog to set up your condition as:
All occurrences of Value are blank -> Disable this control
If you do this, the control should be enabled when one or more items are selected.

how to validate dijit radiobutton?

I have a set of dijit.form.RadioButton elements. I need to be this set as mandatory. When submitting the form it should stop if no radio button is selected. Is this possible?
In your form's onSubmit function, check to see if the radio buttons value is null or not:
if (this.attr("value").radio)
It's true if set to the value of one of the radios, false if null (no radio is selected). Here is a full example.