In my solution I have a Products Table (fields: product_id, product_name), a Sections table (fields: section_id, senction_name), a Subsections table (fields: subsection_id, section_id, subsection_name; related to Sections Table).
I can put every product in any section/subsection using a table, with this fields: product_id, section_id, subsection_id.
In Product Form I like to show (in a window) the sections/subsections where the product is, like this:
You can check the values using code by putting the values in the dataprovider. If you want to check more values you need to delimit them by a return.
Keep in mind that if you use a valuelist with a real and display value you need to set the real value.
In that window I want to show all sections (all values in Sections table) and below every sections all its subsections (all values in Subsections table). Then, I would look for values in the “product-section-subsection” table and I’d check the values in the window.
But how I do it? What datasource I set for the window?
I’d tried to create an html area and put code in it (using <input type=“checkbox” […]>). It works for viewing, but I don’t know how to trigger an action when the user selects a chekbox (it doesn’t work: )
Untested idea: use three table-based value lists based on your sections table where the name of each value list corresponds to a main section value. Not sure about this part: display using three fields attached to the same data provider – each field attached to a different value list. I’m thinking it should work as checkbox field types store and display comma-delimited values and don’t display values not in the value list.
Use labels for your main section headings.
If your main sections are dynamic, do everything with solution model code.
log-out:
You’re right, my main sections are dynamic (records in a table), and now there’re >50 records, so it’s better to do it with solucion model core.
Hi logout, if you have 50+ records in your sections table I do not think that this is the best way for the user interface.
Thinsk about showing all the sections in a list form and another listform containing the subsections (of course related) you can put a check box to each list.
I would add an optiongroup to allow the user display: only marked records, only not marked records or both type of records.
log-out:
You’re right, my main sections are dynamic (records in a table), and now there’re >50 records, so it’s better to do it with solucion model core.
Hi logout, if you have 50+ records in your sections table I do not think that this is the best way for the user interface.
[/quote]
I agree. Typically a merge table is used to handle this sort of thing. Allows you to track other data points like when a section was added to a project, other UI’s can hook into the table, reporting is easier, handle way more records(!), etc.
I like the idea though. Intriguing UI pattern if you don’t need all the other stuff.
jasantana:
Thinsk about showing all the sections in a list form and another listform containing the subsections (of course related) you can put a check box to each list.
This approach sounds better, but if I use sections table as datasource of sections list form and subsections table as datasource of subsections sub-list form, how can I check/uncheck the subsections if that info is in “product-section-subsection” table?