After thinking there were no good reasons for using the the “Page Field Name” property of a PeopleSoft object, I finally found one. Rather than using overly complex (for this purpose) Rowset/Row/Record/Field logic to disable each field in a grid, it is possible to use the Page Field Name in simpler logic to disable each column in the grid.
In this case, when a student accesses my page, I want all of the objects to be editable, but when their parent accesses the page, the only thing the parent should be able to do, other than see the student's information, is click a “Validate Student Information” button on the page. So, for parents, I need to disable several edit boxes, radio buttons, and grid columns. If I use the Page Field Name of the Grid and Grid Column objects, then disabling the grid columns is fairly simple.
Assuming the grid's Page Field Name value is “FAMILY_GRID” and the column's Page Field Name value is “FAM_MEM_NAME” , you can use the following code
&famGrid = GetGrid(Page.MY_PAGE, "FAMILY_GRID");&famGridFamMemName = &famGrid.GetColumn("FAM_MEM_NAME");&famGridFamMemName.enabled = False;
to get the first column in your grid to be disabled (read-only), as shown below.
No comments:
Post a Comment