Is there any way to limit the selection of SelectItem in smartgwt? - smartgwt

I want to limit the check box selection of selectItem in smartGWT. My select item contains "n" number of options but the user wants to select only maximum of 7 options from the selectItem. How can i achieve this?

You can choose from several ways to achieve this.
I would choose between these two options (depending on your application):
Add a CustomValidator to that Formitem. This validator should evaluate to false if the SelectItem contains as value a list with more than 7 elements. Note that such a Validator could transform the value of the item and that you could specify the error message next to the formitem.
Add a ChangeHandler (via addChangeHandler) to the FormItem and chancel ChangeEvents when more than 7 elements are selected (and provide a notification to the user).

Related

Selecting all the items in dropdown using powerapps

I am trying to select all the items in dropdown using Powerapps. Below are the codes I was trying :
Concat(ListBox2_1.SelectedItems, Value & ",")
First(ListBox2_1.SelectedItems).Value
Concat(ListBox2_1.SelectedItems, Value & ",")
Please advise
Currently it is not possible to select multiple default values in the listbox (https://powerusers.microsoft.com/t5/Power-Apps-Ideas/ListBox-support-for-multiple-default-values/idi-p/280491). A control that supports multiple defaults that you can use would be the combo box. In this case, you would use the same expression for the Items property:
["Admin","Finance","HR","IT","ITES","Management"]
and the DefaultSelectedItems property:
["Admin","Finance","HR","IT","ITES","Management"]

Create a query params with combobox in Foxx

I wonder if I can create a query param that take multiple values from dropdown just like a non-typing combobox in the UI of ArangoDB. For example
//A route....
.queryParam('A', joi.any().allow(["true","false,"haha"]).required().default("true"))
The one above produce an dropdow that allow you to choose only 1 value. Is it possible to make them behave like a combo box on arango's UI?
I use this query param join's validation that shows as a drop down in the Arango UI
.queryParam('direction', joi.string().lowercase().valid('inbound', 'outbound', 'any')
.required().description('Direction of traversal from given product (inbound/outbound/any)'
))

How to change format / treat missing values in SPSS

I'm using SPSS modeler and I have a variable that the software recognizes as numeric. So the missing values are $null$. I want that the missing values of the variable are selectionable with '', as character.
So I would: or trasform the format of the variable from numeric to character or change only the missing values from $null$ to ''.
How can I fix?
thanks in advance
The best way to select null values in a numeric field is to use the #NULL() function from the Blanks and Null section of the Expression Builder.
For example, if you wanted to keep only the null values so that you could inspect them, you might use a Select node. Leave the radio button set as Include. Press the Expression Builder (calculator) button. Change the filter in the drop menu on the left side from General Functions to show Blanks and Null (press B 2 or 3 times). Double-click on #NULL(ITEM). Go to the right side and double-click on your numeric field name. Put a Table node at the end and run it.
Using Select #NULL in IBM SPSS Modeler
Another way to view just the null rows is to enter the #NULL(varname) function into the "Highlight records where" section of the Table dialog box.
"Highlight records where" dialog
When you run the table, any row that is true for this condition will be shown in red.
If you really need the variable to be a string, then use a Compute node to create a copy of this field under a new name and use the to_string() function in the Conversion section of the Expression Builder to change the type of the variable. Now you will be able to use the the Select node to grab "" as the missing value. Or you could use the Filler node to replace the column, but then you would not be able to compare before and after.
The dialog examples shown in this answer use this sample stream that is installed with your IBM SPSS Modeler software:
C:\Program Files\IBM\SPSS\Modeler\18.0\Demos\streams\featureselection.str
The easiest way to do it it's using the Fill node with the configurations:
A) FIELD
B) Condition = #NULL(#FIELD)
C) Replace by = ' '
This node will replace all $null$ for ' ' at the same variable chosen in option a.
I don't think you can customize how you visualize $nulls. (I know it's possible in SQL db though)
So I'd suggest that you work with the numbers and when you want to visualize or export the results, then turn the field to a string one then replace nulls:
Filled node > to_string(#FIELD)
Filler node > blank and nulls > #FIELD = ''

cxGrid boolean type group summary item

I have a field (OK) in my cxGrid which is displayed as a checkbox (properties : checkbox). It is an actual database field (boolean) in my SQLite database . Can I group this field so that the grid displays how many items are checked and how many are not (default for groups) ? Right now I managed only to count the items.
The display I have now is something like this :
I need to count checked and unchecked items. Is this possible at all?
EDIT :
In one similar program I have such a feature implemented below) :
Here the sum works since it sums up numbers. In this case I dont know how to sum up
true/false thing... The best next thing I came up in this example is this :
Just changed the field name from 'ok' to' urejeno' ....

how to define different widgets for different rows in dgrid

The dgrid Editor is a column-level plugins, which controls the whole column behavior.
Suppose I have a list of parameters, each has different value type that I want to show in different widgets. For example:
param1 value1(bool, shown as a checkbox)
param2 value2(string, shown as a text input)
param3 value3(enum, shown as a combobox)
param4 value4(int, shown as a NumberSpinner)
....
All the values are in the second column in the dgrid, but they are different types. How do I apply the Editor plugin to the cell level? Is there any method I can use to control individual cell in dgrid?
Thanks.

Resources