Microsoft Word 2013 - form field - based on dropdown value show / hide fields - drop-down-menu

I've got several fields in my document . Based on a dropdown-field I want to show / hide several other fields.
Told in another way. I have a dropdown that have these options "Custom", "As sunday", "Closed". If the dropdown value is "custom" then I should show the field "time". All the other options it should just print the dropdown value.
In my word file, it's like this
[dropdown] [time]
Ex: dropdown value is "custom", the field should be like below (only showing time):
0800 - 1600
Ex: dropdown value is "closed", the field should be like below (only showing the dropdown value):
closed
I've tried to use a formula like this:
{ IF "{dropdown}" = "custom", "", {dropdown} }
I think the problem is that "dropdown" field are changing when a user picks a value from the dropdown. is there a way to insert the value from the dropdown.. like REF "{dropdown}"
If you still don't understand what I'm trying to get.. told in the third way:
if the dropdown shows "Custom" I only want to display the time when the store is open.
if the dropdown shows anything else but custom it should just print the value of the dropdown, and leave the time "blank"

Assuming that you are using legacy form fields, only trying to change what is displayed, not what fields the user gets to enter (it's ambiguous as far as #"time" is concerned) then you need something like this:
{ IF "{ dropdownfieldname }" = "custom" "{ TIME }" "{ dropdownfieldname }" }
where
- all the {} are the special field code brace pairs that you can insert using ctrl-F9 on Windows Word
- dropdownfieldname is the name of the drop down field (set in its properties). It is possible to relocate this bookmark name in which case you will need to rename the dropdown a couple of times at develeopment time to re-impose it
- "custom" must be "custom" as written in the dropdown's list of values. i.e. if it's "Custom", use "Custom". Or use
{ IF "{ dropdownfieldname \*upper }" = "CUSTOM" "{ TIME }" "{ dropdownfieldname }" }
{ TIME } is the built-in time field. If you really want a reference to another form field value, that happens to have bookmark "time", you will probably need "{ ref time }" instead. If your field is actually called "timefield", use "{ timefield }"
If you are using Content controls, IMO the best way to do it is actually to create a custom XML part, link the dropdown result to an element in the part, link a plain text content control to the same element, and literally insert that control where I have put { dropdownfieldname }. Ditto for { timefieldm }

Related

Iterate through each element in a particular column of a dynamic table using cypress

I have a dynamic table displayed based on a value selected from a radio button in my project. The radio button field "Doctor Name" field has different choices like "Frank", "Michael", "Josh", "Jessica". When I select the "Frank" value, it displays a dynamic table with the list of appointments for "Frank", The first column in the table is "Doctor Name". When I select "Frank" from the radio button, I have to validate if all the appointments listed are for "Frank". So I have to write coding in cypress to check if all the first column cell values are "Frank".
How can I achieve this?
retrieve all the first columns using cy.get() with the proper selector, then use the each command to validate the content of each cell, something like this
cy.get("selector for first colums").each(($el, index, $list) => {
cy.wrap($el).contains('Frank')
})

Tableau: How to restrict a dropdown filter to fields that start with "2021*" (a fiscal week field that adds a new field weekly)?

I need an automatic way to have new fiscal weeks (a string that looks like yyyyww) added to my dropdown filter. It's necessary that it's a dropdown unfortunately. Can I just filter out all values that don't start with "2021*" in this particular table? I use those other values in other parts of my dashboard, so I can't filter them out of my data completely.
Create a calculation called DateDisplay as follows:
IF STARTSWITH((STR([Period])),'2021') = TRUE then 'Display'
END
Add the new DateDisplay field to the Filters Shelf and uncheck NULL
Select 'Show Filter' for the string date field
On the drop down menu (down arrow on the right) for the filter which is now showing, select the options 'Only Relevant Values'

Different value and display value for option rows

I have a need to specify different value and display values in an option row (PushRow and MultipleSelectorRow). By display values I mean the values that are displayed in the option selection view controller (not the concatenated list of selected values displayed in the form).
I know this can be done by using a custom class that conforms to Hashable and setting the options property of the row to an array of such class instances.
$0.options = [
MyStruct(value: "1", displayValue: "one"),
MyStruct(value: "2", displayValue: "two"),
MyStruct(value: "3", displayValue: "three")]
However this results in the value of the so configured row being of type MyStruct when getting the form values using form.values as opposed to the actual value I'm interested in being MyStruct.value. This creates the needless complexity of having to map the form values accordingly.
I was wondering if there is a more desirable approach to achieve this? I.e. the values of the row remain a simple data type (say String or Int) but the displayed values in the option selection view controller can be customised.

making my tabular form dynamic

I have a checkbox on a tabular form. I need to be able to hide it if the submit date is not filled in and show it when a date is there. Once the checkbox has been clicked, I need to update another field based on the checkbox being clicked or when I hit the update button. is this possible on a Oracle Apex tabular form in version 4.2?
You can create dynamic actions on tabular form fields, but you need to know some Javascript / jQuery / DOM stuff as it can't be done declaratively as it can with page items.
As an example, I created a simple tabular form on the EMP table:
Using the browser's Inspect Element tool I can see that the HTML for the Ename field on row 3 looks like this:
<input type="text" name="f03" size="12" maxlength="2000" value="Ben Dev"
class="u-TF-item u-TF-item--text " id="f03_0003" autocomplete="off">
The relevant bits to note are the name "f03" and the ID "f03_0003". For all tabular form fields, the name indicates the column, and is the same for all fields in that column. The ID is made up of the name plus a string to represent the row - in this case "_0003" to represent row 3.
Similarly, the Hiredate fields are all named "f004" and have IDs like "f04_0003".
Armed with this information we can write a dynamic action. For example, let's say that whenever Ename is empty then Hiredate should be hidden, otherwise shown. In pseudo-code:
whenever an element with name "f03" is changed, the element with name "f04" on the same row should be hidden or shown.
So we can create a synamic action with a When condition like this:
Event = Change
Selection type = jQuery selector
jQuery selector = input[name="f03"]
i.e. whenever an input whose name is "f03" is changed, fire this action.
The action performed will have to be "Execute Javascript code", and the code could be:
// Get the ID of this item e.g. f03_0004
var this_id = $(this.triggeringElement).attr('id');
// Derive the ID of the corresponding Hiredate item e.g. f04_0004
var that_id = 'f04'+this_id.substr(3);
if ($(this.triggeringElement).val() == "") {
// Ename is empty so hide Hiredate
$('#'+that_id).closest('span').hide();
} else {
// Ename is not empty so show Hiredate
$('#'+that_id).closest('span').show();
}
Because Hiredate is a date picker, I needed to hide/show both the field itself and its date picker icon. I chose to do this by hiding/showing the span that contains them both. This code could have been written in many different ways.
You could apply similar techniques to achieve your aims, but as you can see it isn't trivially easy.

Clear jqgrid toolbar when custom defaultvalue is set

I want to clear the toolbar of my grid, but not to the default value of the column. I want to empty all fields.
When I use the
$("#Jqgrid")[0].clearToolbar();
method the toolbar gets the initial default values..
You can choose one from the following two ways.
1) You can temporary change the defaultValue of the searchoptions to "" before call of clearToolbar. You can use setColProp method for example to change column properties (see en example here).
2) Set the value of the the toolbar element manually to "" or to any other value which you want. There are simple way how the ids of the input or select elements of the toolbar are constructed. Let us you have column with the name 'col1' (the corresponding column of colModel has name: 'col1'). Then the id of the element in the filter toolbar will be gs_col1. So you can use
$("#gs_col1").val("");
to clear the field. In more general case if the colname is the variable which hold the value from colModel[i].name you can use
$("#gs_" + $.jgrid.jqID(colname)).val("");

Resources