Storyboards: what is the "Index Row Limit" field? - xcode

In Storyboards, TableViews have an attribute field named "Index Row Limit". The default is 2. I cannot find any information on what this is. A Google search returns a single page of results and half of the results are non-English. Does anyone know what this field is for?

It's related to the sectionIndexMinimumDisplayRowCount property on UITableView. Basically, if you have less than that many rows in the table, any section index will be hidden. (The section index is the bar on the right hand side of the table that usually has the letters A-Z, which lets you quickly jump through the list.)
Update:
I've verified that setting the "Index Row Limit" in the .xib or .storyboard does indeed change a value in the underlying XML titled sectionIndexMinimumDisplayRowCount, so it's clear that's what this property is supposed to be related to. However, it also appears that there's a bug in UITableView (at least as of iOS 5.1), such that the setting in Interface Builder isn't actually being properly set on the object when it is unarchived at runtime. Time to file a radar!

This value is used to decide when to show the special index list on the right side of table view.If the row count(total number of rows) of table view is greater than or equal to this number the index list on right side of table view is shown else not shown.
Here's the UIKit Documentation:
open var sectionIndexMinimumDisplayRowCount: Int // show special section index list on right when row count reaches this value. default is 0

Related

WCAG - should a table (row) with dynamically populated data be included in the tab order?

For an app a table, that is dynamically populated with data, is important.
How should I do the tab order for tables of data? I searched for guidelines, but could not find a good one so far.
Possibilities I see are:
Only include the table itsef using a 'tabindex=0' attribute in the 'table' tag.
Include the table rows in the tab order with a 'tabindex=0' attribute in the 'tr' tag.
I guess using the arrow keys will allow for detail navigation.
What do you advice?
The table itself and the rows themselves are generally not keyboard focusable because they're not interactive elements. If the row was selectable or expandable, then maybe it could be focusable but it's usually an element in the table row (or more accurately, an element in a the table cell) that is selectable or expandable.
Without more details on the behavior you're trying to achieve, it's hard to give exact advice, but my initial thought is that none of the table elements proper (<table>, <tr>, <td>) should be focusable.
Regarding arrow keys for navigation, that's the pattern for a grid, which is a type of table that has editable cells (similar to a spreadsheet). Again, I don't have enough info on your situation to know if a grid is what you're trying to create.
For screen reader users, they already have a way to navigate to the table and navigate within the table using the screen reader shortcut keys, so don't worry about trying to make things focusable for screen reader users.
Lately I heard another suggestion from an expert.
Generally speaking, all interactive elements should be included in the tab index, such as buttons, form fields and links. If the entire table row can be clicked, this should be in the tab flow by means of a tab index 0.

Indicators in a matrix

I'm trying to add some indicators into a matrix to show an increase or decrease from the previous year
This is my design view
And this is how it's viewed in the report
I would obviously like my up and down arrows to appear in the currently empty columns. Also I'm wondering if there is a way of deleting the first empty column after 2014/15 as there is no year to compare it to.
SSRS supports a function called Previous, which will be useful in your scenario. Assuming that the name of your column group is "Fiscal", the difference of two years can be calculated as
=Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal")
Because you can't know the range of the numbers in advance, I suggest to use a "numeric" expression like
=Sign(Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal"))
for the indicator, so the ranges can be defined by single values -1, 0 and 1:
To hide the first indicator column, right-click the column header in design view and click Column Visibility..., then in the cnfiguration dialog specify to hide based on an expression like
=IsNothing(Previous(Fields!Fiscal.Value, "Fiscal"))
Here's a screenshot of my design view:

Google Sheets - Dynamic Cell Range For Data Validation, Specifically List Of Items Criteria

I am having some issues with specifying a dynamic cell range for a "data validation".
I'm aware you can do some tricky stuff with = "Projections!M4:M"&O2. You can update the content of cell O2 for example to 3 and the output would be Projections!M4:M3.
This makes the value "dynamic". These tricks don't seem to work in the "Cell Range:" input field in the Data Validation selection/configuration screen.
My problem is, I hate seeing drop down arrows (call me o.c.d) for rows that have no content, my number of rows will grow in the future so I don't have any other option than selecting M4:Mfills the whole 1002 rows with drop down arrows.
Has anyone worked out a trick to make dropdown arrows only show up for rows that are filled?
I'm using = COUNTA(B4:B)to get the number of rows that are filled and = "Projections!M4:M"&O2 to make the desired Projections!M4:MX string but the "Cell Range" input field in the Data validation screen doesn't accept this as valid either.
Well I didn't find a direct solution, but something that I can work with to resolve my issue which was I hate seeing drop down arrows for empty rows.
I turned a filter on for a column that will always be filled in and filtered by conditions Cell is not empty but i'd prefer a better solution.

Showing date from two rows in table view, respectively in two text fields, via binding

I have a class named as transaction in which one attribute is transactionDate which is of type NSDate.
I am using NSArrayController to display a list of transactions in a table view.
My requirement is-
I want to show date in first row in a
text field labeled as "From" and date
in last row in a text field labeled as
"To".
My questions is-
Can I achieve this via binding in IB?
If yes then how?
Thanks,
Miraaj
Yes, you can do this (or something like it), see the #min and #max array operators.
Here's how to do a very simple version of this:
Open Interface Builder - create a new application
Add an NSArrayController, set it to automatically prepare content.
Add a Table, label the two columns "name" and "age"
Add a Button (labelled "+") and two Labels (change name to maxval, minval)
Wire up the NSArrayController bindings as follows:
Here's the application running (just in interface builder "simulate" mode). To use it, click + then click on the top row of the table and put a name in the first column and an age in the second. Then repeat for a few more people.
This all looks a bit cryptic, but it is sufficient. I added the labels "Max Age" and "Min Age" for clarity in my version.
Unfortunately this is not something Bindings is particularly good at. You could achieve it but it would be very hacky.
The NSTableViewDataSource protocol is still a perfectly relevant and valid way to provide data to a table. In cases like these (where you're not just presenting a straight-vanilla set of uniform data to a table) the data source protocol is the only sane way to solve the problem. This way you're in complete control of what the table displays.
The only "hard" part is that, if you're using Core Data, your data source class will need to observe the Managed Object Context for changes and reload the data (either -reloadData to refresh the whole table or use -reloadDataForRowIndexes:columnIndexes: to cherry pick the rows you want to refresh).

Binding a table column containing NSPopUpButtons

I've got a table one column of which uses an NSPopUpButtonCell. Try as I might, I can't seem to figure out the way to properly bind everything the way I want it. Here's what I'm trying to do:
I have an NSArrayController plucking items from a managed object context, called 'Field Values'. This is to be used to populate the popup menu for each item (i.e. the list of available choices). I can bind this by selecting the cell in IB and binding its content/objects/values to 'Field Values'.arrangedObjects and 'Field Values'.arrangedObjects.name as appropriate (to get the represented object and the visible title).
I then want to bind the column in such a way that the selected value in each row comes from an array in my controller class, again made visible (and only edited through) another NSArrayController.
So far I've managed to set it up so that every popup menu contains the list of available fields, and that the default value is selected in each of them. Actually selecting an item has no effect, however— it just snaps back to its initial value. I've also managed to find some other variations on this, such as the menu being populated with the selected values, or containing the name of all available values, and the selection containing the -description of the 'none' value I added.
I'm sure I'm missing something fairly simple, but I'm not sure what it is. Presumably there's some subtlety I've missed in how to bind this sort of data (i.e. the Content vs. Content Object vs. Content Value things), but I'm damned if I can see it right now.
Many thanks in advance :o)
I've got a similar set up with a table view, although the data source isn't Core Data based, but I saw one thing you might double check that could be a subtle difference. In my setup for the table column, I have the table column itself bound via content, contentValues, and selectedObject. However, it looks like it's also possible to do the bindings on the actual NSPopUpButtonCell instead. Perhaps it works when the bindings are on the table column, but not when they're on the actual cell? Anyway, there's one thing that might be worth looking into.
Never bind to scroll view, table view or cell.
However, ever bind to table columns.
Watch the title of the Inspector window to be certain of what you're binding.

Resources