Creating template row for an Async table

Hi All,

I have an Async Table in my CAF portlet in which table I need to add rows. This was done already, but I found that in my situation added rows must not be empty. I learned that if the table has a template row than the “Add Row” button will add a row to the table and fill its fields with data found in the template. The problem is that I don’t know how to create such a template row for a table.
Could you please help me with some guidance on that?

Thanks in advance!
Vasy

Your content provider needs be one of the ones that implement IUpdateableTableContentProvider, and you need to set the Support Template Row option to true in the bindings on that content provider.

I think that’s all. Check the bottom of page 219 (v 8.2) in the CAF Developer docs.

  1. On the server side, the data for the template row is whatever is available when you create a new instance of the template row class. So if you populate the row fields in the default constructor of that class, those values should be the initial values for a new row.

  2. Or, if you prefer to populate the new row fields on the client-side, you can add a script that has a table row change listener. When your script gets the callback for the added row, you can populate the fields in that row with additional javascript calls.

Thank you guys for your help. Nevertheless, I feel that what I want to do is about advanced Java coding and scripting in which I have not much experience. I won’t be left without things to learn! :wink: