How do I make a static Radio Group in Google App Maker? - google-app-maker

This is turning out to be harder than I expected. If I want a radio group that just has static options (Yes, No), how do I set that up through the App Maker UI?

Presumably this should work for you. In the options binding do the following:
['Yes','No']
Then also make sure that you deselect the 'Allow null' setting so that your only options are yes or no. Alternatively if your options widget is linked to a datasource field and you only want yes or no as options, then in your model field settings expand the 'advanced' option and find your possible values section and enter Yes and then No and then set the options binding to:
#models.YourModel.fields.YourField.PossibleValues

Related

Is there a way to make a specific item in a multiselect disabled?

I'm really just wondering if anyone has stumbled across this...
In the Widgets API documentation for the Multiselect widget in Google App Maker, the "Styles" section includes a style name for a disabled item:
.app-MultiSelect-Item.disabled Style for the disabled item or items.
I have a case where I'm adding options and values to a multiselect by script based on data pulled from elsewhere. The initial values include the currently selected set of choices, but based on other actions taken by the user, they may not be eligible (via our internal rules and processes) to make that choice anymore.
If there's a way to set a specific item as disabled, I'm envisioning being able to style it with a strike through to communicate that even though that choice is selected now, it's not available as a new choice, and it's going to be removed from the other data source.
So it might be like this:
X Choice A
_ Choice B
X Choice C
_ Choice D
Thoughts?

VSX - How to save options page data

I've create a Custom Options Page with a few TextBoxes, ComboBoxes etc etc.
I have 2 questions though:
I can see that the values I input in the fields remain there if I close/reopen the Options Windows but that doesnt happen if I close VS and reopen. How can I make sure the data is stored "for real?"
How can I access these values from a Action Menu? For instance, I have a menu option Tools > MyButton that will take the values from the options and do some stuff.
Thanks in advance!

User Forms Dropdown Field

for Silvestripe 3.1, user defined form.
I have defined a country dropdown list, it default value is US.
I have searched google, did not find any answer.
I want change default value it to Australia, how can i do that?
If you're talking about the "UserForms" module, then you can set defaults on an option by option basis, all within the CMS itself.
I'm not sure about 3.1, but I'm currently using 3.4 with UserForms v3.1.0, where you can go into the "Fields" tab, edit the dropdown field in question and select the "Options" tab. Now simply checking the box to the right of each option under the "Selected by default?" GridField column, should enable the desired default. I can't imagine it's that different in SS v3.1.

Expose a Drupal Views filter as an on/off checkbox to enable/disable the filter

I have a Drupal view that filters on a taxonomy field. I would like to be able to toggle the filter on/off by exposing a checkbox on the Exposed Filters form.
To illustrate the problem, say for example the Vocabulary is Fruit, and the Terms are Apples, Pears, Oranges and Lemons. I can select citrus fruit content by creating a filter that says Fruit is one of (Oranges, Lemons). Now I would like to expose the filter to allow me to choose whether or not to apply my citrus fruits filter. How can I add a checkbox to the exposed filters forms that will apply the filter when selected, and ignore the filter when no selected?
This is possible:
Add a filter on the appropriate field (term reference to Fruits in
your example).
In the Configure filter criterion dialog:
Set 'Filter type to expose' to 'Grouped filters'.
Check "Allow multiple selections"
Set 'Widget Type' to Radios.
You probably want to empty 'Label'.
Remove all but one of the filter sets in the table below.
In that remaining filter set:
Fill in the label ('Citrus fruits' in your example).
Set 'Operator ' to 'Is one of'.
Under Value select the values you want to filter on (Oranges and Lemons in your example).
This gives you 1 checkbox, labeled 'Citrus Fruits'. So the UI is there. Unfortunately, issue [#2224601] prevents that it works, as it results in an invalid query, but a working patch is available.
Assuming that you are using BEF and that you have checked the "Checkboxes/Radio buttons" option for your exposed filter in the BEF options, the way to set check boxes instead of radio buttons is to check "Allow multiple selections" in the configuration dialogue for your exposed filter in Views.
I think no answer here answers the question.
"What I want is to display a single checkbox that when checked applies/enables the filter, and when unchecked ignores/disables the filter. I don't think Better Exposed filters allows me to do that."
You dont need "Better Exposed filters" to do this.
You need to use grouped filters.
Click expose this filter to visitors
Filter type to expose: Grouped filters
Check 'Optional'
Check 'Widget type: Radios'
Check 'Allow multiple selections'
Remove/empty 'Label' if needed
In the bottom you will have few rows where you can set each one as you wish. If you want only one, remove all but one
Click Apply
This answer is very late. But I hope this helps someone.
You would assume that Views would do this out of the box. It doesn't. Use the Better Exposed Filters module -> http://drupal.org/project/better_exposed_filters
It even has nested checkboxes/radio buttons for taxonomy with hierarchy.
Here's some documentation specific to what you're trying to do...
"Checkboxes/Radio buttons: This option is available for any filter that has a limited number of options. Tick the Force single option to use radio buttons, untick it for checkboxes.
Nested Checkboxes/Radio Buttons: While this option shows for any filter that the regular checkboxes option shows for, it's really only of use for taxonomy filters with hierarchy. If you're using a taxomomy filter with Selection type set to Dropdown and Show hierarchy in dropdown ticked, these filters will be rendered as nested, unordered lists. Tick the Force single option to use nested radio buttons"

Drupal Views & Exposed Filter Dropdowns

I'm using Profile to add a "Department" field to user profiles.
I'm using Views to create a view of users, with "Department" being an Exposed Filter.
The Exposed Filter is a textfield. I'd like for it to be a select dropdown that is populated with all possible values.
Is anyone aware of a module that will alter Views filters, changing fields from textfields to select dropdowns?
Drupal 6. Views 2. The profile field is a single-line textfield (with autocomplete).
i had the same issue in a project
fields that are textboxes show be select box.
as attachment image shows in 'FILTER CRITERIA' choose your field
in 'Filter type to expose' part choose 'Grouped filters'
a table will be shown that you manually can add your data as options
this solution is good when you know your options
this is my RTL settings for expose a textbox filter
this is my RTL settings for expose a textbox options
and in UI - client side this field will be shown like this
What kind of profile field is "Department"? I'm assuming it's one of single-line textfield, multi-line textfield, checkbox or list selection. I only tested it with a list selection, but if you check "Force single" then the exposed filter will be a select dropdown.
Assuming you mean Drupal 6. The above is true with Views 2.x and 3.x on D6.
If you want to modify an existing filter, follow the accepted solution provided here.
If altering an existing filter does not satisfy your requirements, then this step-by-step tutorial will help you creating your own custom Views filter.

Resources