Multi Columns in iOSTable - or Listbox conversion - not well understood

I am moving into IOS in XOJO by converting a WE app and have been successful in getting the db info correctly into iOSSegmentedControl, iOSTextField, iOSLabel. Beyond the learning needed for auto layout and the need to support both iPhone and iPad in landscape or portrait in particular how to go from a multi-column ListBox to IOS as of this writing has eluded me.

On other X-Platform desktop or for that matter WE apps I have readily used ListBox in many configurations to display db table data. However after going through this IOS effort for almost two days on attempting to create a 3 column Table multi row with db table data and display I thought I would reach out and see if some clarity may occur from any responses.

Background:
I have 3 columns of data I need to display whose Header Names are: Name, House Number, Gender
Then I need to grab data from a db table and add the rows to this table
Then when a user clicks - touches - a row more info is retrieved from the db and displayed in appropriate iOSSegmentedControl, iOSTextField, iOSLabels.

Re-Thinking a ListBox to IOS Table is where I am getting lost. I have looked at example apps and other online references and it is still not clear

In XOJO this is what I have which may not be correct.

I dragged a IOS Custom Table Cell onto the navigator. I renamed this to myCustomeTableCell and made its Super iOSCustomTableCell
Then I placed 3 iOSTable next to each other and set positioning to what I think may work. They are named Names_Table, HouseNum_Table, Gender_Table
Next I brought this into my iosView

If all of that is correct I have failed to figure out how to access each Table so I can add rows, detect click, request new db data etc. FYI - I am able to do all that with a simple table. I was placing all info into a single cell per row however that did not display well which is why I am looking at getting the multi-column capability.

Any suggestions - thanks ahead of time.

Having 3 separate tables next to each other will not work well on iPhones, and if you want to have all of the tables scroll together you will want a different approach for iPad as well. Generally iOSTables will stretch across the entire screen, so having 3 different tables next to each other will likely not be an intuitive user experience.

If I’m understanding what you want to do correctly, a decent solution to this should be to create a custom table cell that has a label for each of name, address, and gender and then push to a separate view (or display a popover on iPad) that has the more detailed information you mention. You could also insert a larger row beneath the one tapped with a different custom table cell and have that open downwards with the additional information instead.

To clarify your use of iOSTables and iOSCustomTableCells - table cells are inserted into tables, and should only include things like labels, text boxes, switches, and images. Each record you want to display will appear in another instance of the custom table cell. Since you are using it in conjunction with a database, be sure to implement the table data source interface so that you can serve the data dynamically as the user scrolls instead of all at once which will be laggy (paging the data into memory and holding it until it is requested by the data source interface is the standard approach).

Hopefully this helps

@Jason King - thanks - I attempted 3 tables next to each other and yes scrolling to keep synched is interesting. I dropped this because it simply did not look good

There is another piece I am looking at which is there is an address piece which if I can figure out how to change a rows color I can keep the rows that have the same house number one color and then change to another when they are not. this would allow me to group people in the table by house number. This would allow grouping which is what I used the multiple columns for.

On iPad this all works great but I am having to think about how to accomplish on iPhone. Looks like using iosScreen and then detecting iPhone/iPad and its orientation are next on the list

Hi Carl,

To make thing easier I would recommend locking iPhone screen to portrait only (Home button at bottom).
But on iPad accepting any orientation.

iOSCustomCell is the way to go when going from a Listbox display (Web) to an table display (iOS).
You are actually luck that there are only 3 columns in the listbox, it takes a lot of thinking/testing when trying to display 5-10+ listbox columns in a single iOSCell.

It might actually be easier if you could post a screenshot of the Web Listbox so we can understand and give advice on displaying it in an iOSTable.

@Jeremie Leroy - ok - I have redacted data and here is a snapshot of a web page that fits onto iPad v4 and newer screens. This provides capability for people walking campaigns.

As you select the wide PopupMenu (contains Roads) individuals are populated in the ListBox. Then when you select a individual the information on the right is cleared and then their info is populated in the right.

The layout fits nicely (especially color formatting capabilities) with such efforts and significantly reduces printed paper needs. The WebPopupMenus work great. In IOS the Picker aspects or segmented controls take up a bit more room, while they look ok some functionality like resetting the value to -1 like you can in the RAD value settings fails - well at least at this time I have not figured out how to and may be a Declare aspect I will need to look into for that functionality.

The listbox next implementation is to combine First Name and Last name to create 3 columns.

What is preferred in IOS over the WEB is that when the screen times out the session is something that needs to be addressed otherwise you must re sign in. A solution for this is in progress and may be related to the lack of a Web Service. The IOS solution demonstrates itself to stay connected after implementing a modification to LUNA for our specific needs.

LUNA is freakin nice and addressed a solution I was working on for quite some time. Sometimes it pays to stop working and reading! Also looking at updated ALOE. Big cred to Tim Dietrich and Paul Lefebvre on the Web data service capabilities.

I figured out how to set cell rows to the same color when the previous was the same house number and change when a different house number. Now I am working on how to clear the segmented controls to -1 as you can in the RAD. I verified I can read the value and place as Text to MsgBox but setting to any value to represent the segmented control including -1 throws an exception. Not certain why as an example works provided it is not set to -1 and is within the segmented range

Would still be good to se how to create multi column iosTables and understand that.

try:

declare sub setSelectedSegmentIndex_ lib "Foundation" selector "setSelectedSegmentIndex:" (obj_id as ptr, idx as integer) setSelectedSegmentIndex_(MySegmentedControl.Handle, -1)

@Jason King - very nice - thank you

Looks like finding how to make such Declares is going to be the key to making a more full IOS app in XOJO.

If accurate I have been looking for a link to such equal aspects to code in XOJO. If you have one or can make any suggestions as to links that would be great.

Between my iOSKit (https://github.com/kingj5/iOSKit) and @Jeremie Leroy 's iOSDesignExtensions (https://github.com/jkleroy/iOSDesignExtensions) most of the declares you will want are exposed. I recommend you check those out as a starting point. The Apple docs are a good resource as well, and most of the classes and example code you see there will often translate directly into calls into iOSKit classes.