Reuben B.
Posts: 1126
|
« Reply #1 on: August 26, 2011, 01:25:06 am » |
|
Back 6,7 years ago when I first migrated the application I was working on into Genero, I had the similar problem. For our customers who sold shoes, clothing etc they all had this additional level of detail we called "colour and size" so that when ordering, as well as specifying that they ordered 1000 of a product, you had to determine how many of each colour and size combination was to be ordered.
We had a similar solution to what you described. Pick an arbitrarily large number for the number of columns, name your columns size01, size02, size03 etc. Use DOM Tree manipulation to give each column an appropriate title (Small/Medium/Large or 4,4.5,5,5.5 etc), and Dom Tree manipulation to hide the columns that weren't used. Then INPUT ARRAY to enter the values, or DISPLAY ARRAY to simply view them. We also had functionality to select an individual cell but as DISPLAY ARRAY will only tell you what row you have selected it, this had to be an INPUT ARRAY where we ignored what the user keyed in, and when they pressed ENTER determined the selected colour/size by interrogating the current field and row.
In the last few years working for FourJs A/P I've seen lots of similar code. The one approach I've seen different was someone who didn't need to edit the data, they just needed to view it. They used a TEXTEDIT with textFormat=html, and created an HTML table with a variable number of rows and columns and displayed it to the TEXTEDIT, just be careful if you have a large number of rows/columns with this technique as the whole TEXTEDIT value is sent to the GDC, not just the visible rows and columns.
I haven't seen anyone attempt to use a WEBCOMPONENT to solve this issue. I had a brief look at using a PivotTable WEBCOMPONENT (see attached screenshot) and there would be a potential solution in that direction as well.
There is a number in the system to track who would benefit from a widget designed to work with two or three dimensional arrays. If you want to add your name to it, ask your support contact to add you to the list of requestors for Bz16643. IMHO we lack a suitable widget that would act as the default widget/container for 2 or 3 dimensional arrays, similar to how we lack a suitable widget for DATETIME and INTERVALS.
Reuben
|