load( local!itemsToken, local!countryIds_int:ri!country_cdt.countryId_int, a!sectionLayout( firstColumnContents: { a!linkField( labelPosition: "COLLAPSED", links: a!dynamicLink( label: char(10012) & cons!CMN_ADD_NEW_COUNTRY, value:'type!{http://172.18.1.27:8080/suite/types/}CMN_Country'(), saveInto: { a!save(ri!country_cdt,append(ri!country_cdt,save!value)), a!save(local!itemsToken,append(local!itemsToken,save!value)) } ) ), if(rule!CMN_isEmpty(ri!country_cdt),{},{ a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label:cons!CMN_COUNTRY_NAME, align: "CENTER"), a!gridLayoutHeaderCell(label: "", align: "CENTER") }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE"), a!gridLayoutColumnConfig(width: "NARROW") }, rows: a!applyComponents( function: rule!CMN_addNewRowForCountry( country_cdt: ri!country_cdt, index: _, itemsToken: local!itemsToken, countryIds_int:countryIds_int, deletedCountryIds_int:ri!deletedCountryIds_int ), array: if(or(isnull(ri!country_cdt),count(ri!country_cdt) < 1),{},1 + enumerate(count(ri!country_cdt))), arrayVariable: local!itemsToken ) ) }) } ) )