CA Service Management

  • 1.  How can I prepopulate a select field using ca_fdAddTableRow

    Posted 11-03-2017 02:51 AM

    Hi Guys,

     

    I'm trying to fill a table using the ca_fdAddTableRow method. This is working for textfields without a problem but one column contains a dropdownlist (select field) with 4 options and I didn't find a way to pre select the 4th entrie from that list. 

     

    So far I tried to use the selected index attribute from the field itself and to set it with the ca_fdAddTableRow method by name and index but none of them worked.

     

    Cheers

    Chris



  • 2.  Re: How can I prepopulate a select field using ca_fdAddTableRow

    Posted 11-03-2017 12:15 PM

    Hi,

     

    Here's an example for how to accomplish this.  Replace the table_id with your table, the sel_id with the select column ID, and the sel_value with the value of the option you want to set.

     

    ca_fdAddTableRow(ca_fd.formId,'table_id',{'sel_id':'sel_value'})

     

    Edit: Updated the example. My first post was incorrect.  



  • 3.  Re: How can I prepopulate a select field using ca_fdAddTableRow

    Posted 11-06-2017 03:01 AM

    Hi Grant,

     

    that was also my idea but this doesn't work for me... here is my code:

    ca_fdAddTableRow('verz_member_acc','Tabelle_Verz_Pfad',{'folder_name':result[i]['folder_name'],'mitglied':result[i]['mitglied'],'recht':result[i]['recht'],'Zugriff':'keine'});

     

    The _ID from my select column is 'Zugriff' and the value of the option I want to select is 'keine' but when I try it that way, nothing gets added to the table. 



  • 4.  Re: How can I prepopulate a select field using ca_fdAddTableRow
    Best Answer

    Posted 11-06-2017 07:22 AM

    Hi, 

     

    Also make sure the select fields eager attribute set to true. You can then test the addTableRow function in the console. 

     

    ca_fdAddTableRow('verz_member_acc','Tabelle_Verz_Pfad',{'Zugriff':'keine'});