You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

hiding row in a grid with two levels 0 and 1

2 replies [Last post]
sevenreindeer's picture
User offline. Last seen 1 year 2 hours ago. Offline
Joined: 07/29/2009
Posts: 1

Hello. I'm new to Peoplesoft and new to this community. I am trying to hide a row within a grid. I found this code on this site:Local Rowset &Level1;

&Level1 = GetLevel0()(1).GetRowset(Scroll.PERSON_ADDRESS);
For &i = 1 To &Level1.ActiveRowCount
&AddrType = FetchValue(Scroll.PERSON_ADDRESS, &i, PERSON_ADDRESS.ADDRESS_TYPE);
If &AddrType <> "HOME" Then
&Level1(&i).Visible = False;
End-If;
End-For;

I'm confused on where to place this code. Could someone help please?

Thanks

accasey's picture
User offline. Last seen 52 weeks 1 hour ago. Offline
Joined: 06/12/2009
Posts: 5
Re: hiding row in a grid with two levels 0 and 1

It kind of depends on how this will occur... Will the hiding occur on page load, after the page has been saved, after the user has clicked a button etc.

If its after page load, you can try putting it on the level 0 record rowinit, page activate peoplecode or component postbuild peoplecode. Because you are looping through the level 1 rowset you would normally have your code execute at a higher level in the buffer, i.e. level 0. Note that the component postbuild and page activate code do not execute at a specific buffer level like record peoplecode does.

Also that FetchValue() is the old style of writing PeopleCode. Instead you could do this:
For &i = 1 To &Level1.ActiveRowCount;
&AddrType = &Level1(&i).PERSON_ADDRESS.ADDRESS_TYPE.Value;
If &AddrType <> "HOME" Then
&Level1(&i).Visible = False;
End-If;
End-For;
Note that this "&Level1(&i).PERSON_ADDRESS.ADDRESS_TYPE.Value" is a shortcut for &Level1.GetRow(&i).GetRecord(Record.PERSON_ADDRESS).GetField(Field.ADDRESS_TYPE).Value.

Peter.Wan's picture
User offline. Last seen 49 weeks 6 days ago. Offline
Joined: 08/13/2009
Posts: 9
Re: hiding row in a grid with two levels 0 and 1

Good idea,thank you for your share.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
3 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.