Hi guys,
I am having a grid where a set of data will be on display. In a column I have used Icon indicator and a dynamic link. When I click it should change from true to false or false to true and the respective icon sholud change in the grid. Any solution for that. I have tried some ways but in the save option of dynamic link I am struck. Thanks in Advance.
Regards,
Kavya
Discussion posts and replies are publicly visible
Please post your code, at least the saveInto.
a!gridImageColumn( label: "Active?", field: "active", data: { a!forEach( items: index( local!data, "active", {} ), expression: if( fv!item = 1, a!documentImage( document: a!iconIndicator( icon: "STATUS_OK" ), caption: "Yes", link: a!dynamicLink( label: "change", value: if( fv!item = 1, false, true ), saveInto: a!save( ri!change, if( fv!item = 1, false, true ) ) ) ), a!documentImage( document: a!iconIndicator( icon: "STATUS_NOTDONE" ), caption: "No", link: a!dynamicLink( label: "change", value: if( fv!item = 1, false, true ), saveInto: a!save( ri!change, if( fv!item = 1, false, true ) ) ) ) ) ) }/*index(local!data,"active",{})*/ )
ri!change is a boolean variable I used for checking purpose. It was supposed to replace the value in local!data .
I assume ri!change is a multiple. Then you need to address that specific value in that list. Use the square bracket notation. And there is no need to compare a boolean to "1".
It might be necessary to pre-populate ri!change with as many items as you have in your grid.
value: not(ri!change[fv!index]), saveInto: ri!change[fv!index],
It was throwing error.
This is why I wrote "It might be necessary to pre-populate ri!change with as many items as you have in your grid."
Now it is saving the changed boolean values in ri!change. I have to save this ri!change to the local!data value ryt?
Also the values getting change in ri!change but not the icons.
Yes.
You might need to change the logic for the dynamic image a bit to work with the correct value.
there are several issue not quite fine:
a!gridImageColumn( label: "Active?", field: "active", data: { a!forEach( items: index( local!data, "active", {} ), expression: { a!documentImage( document: a!iconIndicator( icon: "STATUS_OK" ), caption: "Yes", link: a!dynamicLink( label: "change", saveInto: { a!save( target:local!data[fv!index].active, value: true ), /*bot sure if necerssary, depends on your construct*/ a!save( target:ri!change[fv!index], value: true ) } ), showWhen: toboolean(fv!item)=true ), a!documentImage( document: a!iconIndicator( icon: "STATUS_NOTDONE" ), caption: "No", link: a!dynamicLink( label: "change", saveInto: { a!save( target:local!data[fv!index].active, value: false ), /*bot sure if necerssary, depends on your construct*/ a!save( target:ri!change[fv!index], value: false ) } ), showWhen: toboolean(fv!item)=false ) } ) } )
Hi Richard,
I am facing this error.
The issue was to add pagination in editable grid. Since it is quite tricky and have disadvantages, we split the table to two. A grid field where the read only data from db is there and a editable grid below to add new data. So when the new user gets added it should check whether the user is active or not in the first table and also within the editable grid. If count of active user is greater than 1 it will throw error and ask user to change any one of the active so in grid field we need a option to change the active status. I have'nt coded for validation also. It is working within editable grid but not between 2 tables.
What appian version are you using? You're using the deprecated version of the Paging Grid and that makes things 10 times harder than they need to be.
It is 17 version I think. The development environment still uses this version.
I strongly advise your project management to upgrade to a recent version - versions as old as 17.x are not really supported anymore and you will have a hard time finding relevant support here for functionality that old.