Collection Reference is broken - velo

This is about Wix collection references.
I have 2 collections set up. Collection 1 is a list of people with addresses and includes a state abbreviation field. Collection 2 is a list of states, with other state info, and 1 of the fields is the state abbreviation, which is the Main Field.
On collection 1, when I change the state abbreviation field from Text to Reference, and set the correct referenced collection, then all the field's values change to "Reference is broken". I can edit each item and set the value to it's correct value.
Am I doing something wrong or is that how Wix references work? Do you have to set EACH reference item's value?

In your case, you will have to change each item's reference value. In general, it is recommended that you start with the proper field type so you don't run into issues like this.
You need to change each item because the reference field does not actually hold the value from the Main Field of the referenced collection (e.g. NY). Really, it holds the ID value from the referenced collection (e.g. 363293a4-4b8f-45c1-9559-6cfc2b37c9f9).
You can verify that this is indeed the case by setting the reference values and then switching the field back to Text. You will see the IDs. You can then switch back to Reference and it will work properly because the ID is what the reference really uses.
One benefit of this approach is that you can easily change the Main field in the referenced collection without breaking the references.

Related

How to limit the number of records displayed in a cross reference field in RSA ARCHER?

My current cross reference field show all the record references it gets in Child records. I want to limit it to 5. How can this be done in RSA archer
Navigate to the application/ questionnaire where your field exists. Within the cross reference field you’d like to update, navigate to the option tab and all the way at the bottom there is a ‘Configuration’ section. Within that there is a ‘Default Records Display’ with values ranging from 5-50 ( in increments of 5) and All. Changing your cross references to 5 should achieve what you’re looking to do.
Well Gupta, that depends on if you can filter the records down to a specific amount. Currently Archer cannot just return the "top 5" records.

Kentico 12: change value of one page type field based on value of another field

I have a custom page type with two fields, StateName and StateCode. I would like it so that when a value is selected in either of these fields, the other field’s value changes to match.
So for example, if I select “Alabama” in the StateName field, the value of the StateCode field would automatically change to “AL.” Or if I select “CO” in the StateCode field, the StateName field would automatically change to “Colorado,” etc. Is this possible?
(I have to keep these as two separate fields, because I need to display either the state name or the state code on the front-end depending on context. Therefore, I can’t use a single field with options like AL;Alabama because then the field only returns the value AL and I have no way of getting the display name Alabama).
I know Kentico has options for setting “dependent” fields, but that only appears to determine visibility – e.g. only display Field B if I select a particular value in Field A. I can’t find a way to actually change the selected value in one field based on the selected value in another field.
Two control solution seems some kind of an overkill here. You can use StateInfoProvider to get what you want.
StateInfo state = StateInfoProvider.GetStateInfo("Alabama")
The other way would be to use a simple drop down control and use
query like that :
select stateCode + '|'+ StateDisplayName, StateDisplayName from cms_State
to get get code and display name as value separated by |

How to correctly bind a DDL in LibreOffice Calc

I'm trying to bind a serie of simple lists with 2 values to a DDL in LibreOffice Calc. I want the DDL show the description and that returns the relative ID in the linked cell. I currently can just partially do that, I'm unable to show the description in the DDL, as per my image:
I have other lists but the concept is the same, the list should always show the decription and return the relative ID, every list is on its own, so element in list A is not in list B as they are groupped up by type.
The following are the settings in my DDL, the marked setting is always disabled, regardless of what other setting I select. The marked setting should be "data field" and I suppose that it should allow me to specify what column in my list contains the data.
In your example, the control is not bound to any data source. So, it cannot be bound to an underlying field.
The full solution is to create a data source in LibreOffice Base and then use it as the underlying source for the form. Then it is straightforward to bind the combo box control to a field, either through a wizard or by changing the settings.
However, perhaps you want to avoid the complexity of Base. In that case, if the descriptions are unique, then use those as the source of the list, and get the IDs with a function such as VLOOKUP.
EDIT:
Here is an example of VLOOKUP in A6, where A5 is the linked cell.

Unable to make jqGrid to work for composite key

I still have problem defining composite key in jqGrid. Even though I set the 3 fields that are the composite key with attribute 'editable: true', the jqGrid does not behave correctly. I haven't used any 'key=true' in any of the fields as the jqGrid document mentions it that not more than one field can use this attribute. When I point to one of the rows in the List View, jqGrid high lights two rows, instead of one row. Is there any other attribute I need to use to specify more than one field for the composite key.
The usage of composite key is very easy. The property id if input items is used by default as the key (rowid). Thus you need just fill the input data with id properties, which constructed from the 3 fields and some separator, like _ for example, which is not a part of the field. If you will have some implementation problems, then you need just include an example of input data and the composite key, which you want to have.

GWT (smartgwt) grid sort selected records top

I have a grid where the user can select records via checkbox in front of every record. Now I have a requirement to sort the records based on their selection, so that all selected records should be placed top, followed by the not selected ones.
Is there any standard function to achieve this? As an alternative I thought of saving the selection state as an attribute on every record and sort based on the attribute.
The code for the column is:
gridRealmDt.setSelectionType(SelectionStyle.SIMPLE);
gridRealmDt.setSelectionAppearance(SelectionAppearance.CHECKBOX);
I try to describe the code I use as the affected code is deeply nested in our own framework classes.
gridRealmDt is a subclass of smartgwt ListGrid. In my Dialog a create an instance of the grid which creates an instance of a database bound datasource. When the dialog is loaded the records are fetched from the database and after that a registered an dataArrivedHandler where I select the records which match records from another table.
I tried to place the selection attribute in an extra field and use that for sortig before my other sort criteria, but this does not work. Here is the code for the field I am using.
ListGridField txtSelected = new ListGridField(SELECTED, "");
txtSelected.setHidden(true);
txtSelected.setSortByDisplayField(true);
txtSelected.setCanSortClientOnly(true);
When I do not set the canSortClientOnly property the order by is sent to my database resulting in an error, as the table does not contain that field, so I set the property. Now I get following error
Removing field from the sort Specifier array because it specifies canSort Client Only: true and all data is not yet client-side.
I also tried to use a sortNormilizer on the Name field which is my main sort criteria, but the normalizer is called before the selection value is set to the record.
record.setAttribute(CARealmDS.SELECTED,selected ? "a" : "b");
I also cannnot find a way to call the normalizer when selection changes.
Currently we are using Smart GWT Version 6.0p.
I don't think there is any standard function. Just use grid store update. Place checked items first.

Resources