Forum OpenACS Development: forms as columns of template::list

Hello,

I need to setup a table where one of the columns contains a form, a text input.

If I want to use "template::list", the only alternative to do this is the "display_template" property of elements. This way, I build the form HTML in the tcl file and the I include this piece of HTML with the "display_template" property. And it works.

However, when applying the design guidelines proposed by the Accesibility Tutorial in Valencia, I found that building HTML in tcl files is not recommended at all, and the use of "display_template" is explicitly discouraged.

My question: Is there any other way to include a form as part of a table created with "template::list"? And if not, does it make sense to modify the template and include this functionality?

Best,
Luis

Collapse
Posted by Emmanuelle Raffenne on
Hi Luis,

I would recommend to avoid including forms in a table as much as possible. That's why IMO it doesn't make sense to provide this functionality in template::list.

I can't think of any better way to include a form than using display_template. But is including the form in the table the only solution for your user interface?

Collapse
Posted by Luis de la Fuente on
Well, I have to present several parameters of a (maybe)large number of users. I think a table with template::list fits for this situation.

The special requirement appears because some of these parameters may be writable, so I put a form there.

If your recommendation is to avoid forms in a table, I will explore other alternatives. Do you have any suggestion?

Anyway, I'm not pretty sure about what kind of accesibility problem appears when you include forms in a table. Just for understanding, could you tell me more about it?

Collapse
Posted by Emmanuelle Raffenne on
Hi Luis,

Without seeing the interface or a clear picture of it, it's not easy to imagine or to have an opinion. On the other hand, I don't know what problem you're trying to address with this table and forms.

Anyhow, it's not really an accessibility issue but more an usability one (these are very related anyway). The purpose of a table is to display data, changing the data would be a separated action the user would decide to do (by pressing a "edit" button for example). Also, if you expect to have a large number of users on this table, you may want to consider pagination.

Collapse
Posted by Dave Bauer on
Direct action is MUCH easier in general. Imagine a spreadsheet.

The idea is to reduce the number of steps for a user.

I think in this case an edit button that either

1) opens the form in a new page
or
2) openacs an inline ajax form if the user's browser supports that.

We don't have good guidelines on how to add that type of interaction in an accessible way, so it's hard to say if we could accept that type of implementation in OpenACS or .LRN but you could certainly implement it for a local internal application as long as it met your specific requirements.

Using display template is the best way to accomplish your goal. You don't need a form for every row, but just a form element in each row. I am not sure about the validation requirement for forms and tables though. You will have to look it up.

Collapse
Posted by Emmanuelle Raffenne on
Dave, Luis,

From the accessibility point of view, having one form with a form element in each row is not a good solution.

Collapse
Posted by Luis de la Fuente on
Emma, I agree, this is not a good solution. Maybe it looks better if we don't take into account the accesibility. But if we do...

I will reconsider the user interface.

Thank you for your comments.

Collapse
Posted by Ryan Gallimore on
Hi Luis,

If forms within a table cause an accessibility problem, perhaps you can write your own template for the list using divs.

Create a new adp file in /packages/acs-templating/resources/lists/ and reference it in

<listtemplate name="mylist" style="newlisttemplatefile"></listtemplate>

You can look at list.adp in the directory above for an example. Play with the CSS at /packages/acs-templating/www/resources/lists.css

Good luck,
Ryan

Collapse
Posted by Emmanuelle Raffenne on
Hi Ryan,

I'm afraid that marking up the data with DIV won't solve the accessibility problem. Actually, it would introduce another one. Tabular data has to be marked up using the TABLE element and the corresponding TH/TD and their attributes to associate header cells with data cells.

This is documented in WCAG 1.0 (checkpoint 5.1 and 5.2 - priority 1) and in WCAG 2.0 (technique H51 for success criterion 1.3.1 - level A).

Collapse
Posted by Ryan Gallimore on
Hi Emmanuelle,

Would it be possible, then, to accomplish accessible markup using a custom template, as I suggested above?

Collapse
Posted by Emmanuelle Raffenne on
Valid markup is not a guarantee of accessibility by itself, although it's part of it. Using appropriate markup is even more important. HTML is primarily used to structure the content semantically (not to format it), so each type of data has to be marked up according to its nature.

In this case, the problem is not the template. The default template for template::list produces valid and appropriate markup for tabular data. Using a table to format a form is acceptable from the accessibility perspective (as long as a few rules are followed), but not recommended. The problem here would be to mix the two types of content: the data and the form to modify it.