Selecting Row in a Read Only Grid
Hi,
I have designed one GRID where I am successfully able to capture the selected value.
I am using Processstart link to update the EmpSubType column.
My Requirement is:
The selected value should be captured as soon as I am clicking any random EmpSubType(I do not want to first tick the check box and click on EmpSubType value . )
The selected value is getting captured correctly when I am selecting any row and then clicking the SubType. I am not selecting the check box first and then selecting any EmpSubType randomly then Start Process Link is taking a wrong value.
I am pasting my codes here:
Could someone please help me here?
Thanks
a!localVariables(
local!typeData:rule!FF_EMP_QE_EmpTypes(empType: null),
local!empType,
local!selectedRows,
local!selectedEmployee,
local!typeId:index(local!typeData.typeid,wherecontains(local!empType,touniformstring(local!typeData.emptype)),{}),
{
a!sectionLayout(
label: "",
contents: {
a!columnsLayout(
columns:
a!columnLayout(
contents: {
a!dropdownField(
label: "Employee Types",
labelPosition: "ABOVE",
placeholder: "--- Select a Value ---",
choiceLabels: {local!typeData.emptype},
choiceValues: {local!typeData.emptype},
value:local!empType,
saveInto: {local!empType},
searchDisplay: "AUTO",
validations: {}
)
}
)
),
a!gridField(
data: a!queryEntity(
entity: cons!FF_ENT_EMPSUBTYPE,
query: a!query(
selection: a!querySelection(
columns: {
a!queryColumn(
field: "empsubtype"
),
a!queryColumn(
field: "emptype"
),
a!queryColumn(
field: "typeid"
),
a!queryColumn(
field: "empid"
)
}
),
filter:if(isnull(local!empType),null,a!queryFilter(
field: "emptype",
operator: "=",
value: local!empType
)),
pagingInfo: fv!pagingInfo
),
fetchTotalCount: true
),
columns: {
a!gridColumn(
label: "Empsubtype",
sortField: "empsubtype",
value: a!linkField(
label: "Start Process",
links:a!startProcessLink(
label: fv!row.empsubtype,
processModel: cons!FF_PM_SUBTYPEUPDATE,
/*We have to pass dictionary*/
processParameters: {empId:local!selectedRows}
)
)
/*value: fv!row.empsubtype*/
),
a!gridColumn(
label: "Emptype",
sortField: "emptype",
value: fv!row.emptype
),
a!gridColumn(
label: "Typeid",
sortField: "typeid",
value: fv!row.typeid
),
a!gridColumn(
label: "Empid",
sortField: "empid",
value: fv!row.empid
)
},
pageSize: 20,
initialSorts: {},
selectable: true,
selectionValue: local!selectedRows,
/* Using the index function to return the last-selected item ensures that
only one item will be selected at a time, regardless of how fast the user clicks. */
selectionSaveInto: {a!save(local!selectedEmployee, index(fv!selectedRows, length(fv!selectedRows), null)),
/* We use the same method as above to limit the selection variable. */
a!save(local!selectedRows, index(save!value, length(save!value), null))}
),
a!recordActionField(
actions: {a!recordActionItem(
action: 'recordType!{abd29c56-81fd-455f-a4d9-25cee496c62c}FF_EMP_RC_Detail.actions.{33cc01b3-6f31-47b8-a75f-d5eacfbd1169}addEmp'
),
a!recordActionItem(
action: 'recordType!{abd29c56-81fd-455f-a4d9-25cee496c62c}FF_EMP_RC_Detail.actions.{888454cb-b159-4263-8c01-a771c96ff919}updateDetails',
identifier:local!typeId
)
/*a!recordActionItem(*/
/*action: 'recordType!{abd29c56-81fd-455f-a4d9-25cee496c62c}FF_EMP_RC_Detail.actions.{1d04663f-eeb9-40e5-8d80-ef10a128a931}UpdateSubType',*/
/*identifier:local!selectedRows*/
/*)}*/
}
)
}
)
})