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.

Peoplesoft HTML Area Issue

1 reply [Last post]
ashok_star2004's picture
User offline. Last seen 34 weeks 16 hours ago. Offline
Joined: 02/13/2009
Posts: 45

Hi All,
Im designing a page in Peoplesoft with an object HTML Area.Im able to expand the root and 1st level child nodes.When im trying to expand 1st level child im getting the child leaves along with a repeated 1st level child node as

First | Previous | Next | Last | Left | Right
-ERPA_AK_AE_6
-Records
+Records
ERPA_AK_APP_6

Where ERPA_AK_APP_6 is the Record present in the Project ERPA_AK_AE_6.Im fetching the records from the project using "CreateSQL".Im trying so that the 1st level child node(Record) should not expand again.Please help me..
My Peoplecode is as below:
---------------------Beginning of the code-----------------------------------------

Component Post build Event:-

Component Rowset &TREECTL;
Component string &TEST;
Component boolean &FIRST;
Local ApiObject &MYSESSION;

&NODE_ROWSET = CreateRowset(Record.EA_TREECTL_NODE);
&TREECTL = CreateRowset(Record.EA_TREECTL_HDR, &NODE_ROWSET);

&TREECTL.InsertRow(1);
&REC = &TREECTL.GetRow(2).GetRecord(1);

&REC.GetField(Field.PAGE_NAME).Value = "ERPA_AK_TEST_TREEV";
&REC.GetField(Field.PAGE_FIELD_NAME).Value = "TREECTLEVENT";
&REC.GetField(Field.PAGE_SIZE).Value = 15;
&REC.GetField(Field.DISPLAY_LEVELS).Value = 8;
&REC.GetField(Field.COLLAPSED_IMAGE).Value = "PT_TREE_COLLAPSED";
&REC.GetField(Field.EXPANDED_IMAGE).Value = "PT_TREE_EXPANDED";
&REC.GetField(Field.END_NODE_IMAGE).Value = "PT_TREE_END_NODE";
&REC.GetField(Field.LEAF_IMAGE).Value = "PT_TREE_LEAF";
&REC.GetField(Field.IMAGE_WIDTH).Value = 15;
&REC.GetField(Field.IMAGE_HEIGHT).Value = 12;
&REC.GetField(Field.INDENT_PIXELS).Value = 20;

&MYSESSION = %Session;
&SRC_TREE = &MYSESSION.GetTree();
&ROOT_NODE = &SRC_TREE.FindRoot();
SQLExec("SELECT PROJECTNAME FROM PSPROJECTDEFN WHERE PROJECTNAME LIKE 'ERPA_AK_AE_6'", &TEST);

&parentnode = &TEST;
&PARENT_FLAG = "X";
&Root_Row = 1;
&NODE_ROWSET = &TREECTL.GetRow(2).GetRowset(1);
&NODE_ROWSET.InsertRow(1);
&REC = &NODE_ROWSET.GetRow(2).GetRecord(1);

&REC.GetField(Field.LEAF_FLAG).Value = "N";
&REC.GetField(Field.TREE_NODE).Value = &parentnode;
&REC.GetField(Field.DESCR).Value = "";
&REC.GetField(Field.RANGE_FROM).Value = "";
&REC.GetField(Field.RANGE_TO).Value = "";
&REC.GetField(Field.DYNAMIC_FLAG).Value = "N";
&REC.GetField(Field.ACTIVE_FLAG).Value = "Y";
&REC.GetField(Field.DISPLAY_OPTION).Value = "B";
&REC.GetField(Field.STYLECLASSNAME).Value = "PSHYPERLINK";
&REC.GetField(Field.PARENT_FLAG).Value = &PARENT_FLAG;
&REC.GetField(Field.TREE_LEVEL_NUM).Value = 1;
&REC.GetField(Field.LEVEL_OFFSET).Value = 0;
&REC.GetField(Field.EXPANDED_FLAG).Value = "N";

EA_DERIVED_HTML.HTMLAREA = GenerateTree(&TREECTL);

Record field change Event code:-

Component Rowset &TREECTL;
Component boolean &FIRST;
Component string &LEAF_FLAG, &a9;
Component string &PARENT_FLAG;
Local integer ∫

If Left(EA_DERIVED_HTML.TREECTLEVENT, 1) = "X" Then
&ROW = Value(Right(EA_DERIVED_HTML.TREECTLEVENT, Len(EA_DERIVED_HTML.TREECTLEVENT) - 1)) + 1;
REM Warning " " | &ROW;
&NODE_ROWSET = &TREECTL.GetRow(2).GetRowset(1);
&PARENT_REC = &NODE_ROWSET.GetRow(&ROW).GetRecord(1);
REM Warning " " | &PARENT_REC;
&PARENT_LEVEL = &PARENT_REC.GetField(Field.TREE_LEVEL_NUM).Value;
Warning "all " | &PARENT_LEVEL;
&ROW = &ROW + 1;
REM Warning " " | &ROW;

&NODE_ROWSET.InsertRow(&ROW - 1);
&REC = &NODE_ROWSET.GetRow(&ROW).GetRecord(1);

REM Warning " " | &str;
&REC.GetField(Field.LEAF_FLAG).Value = "N";
&REC.GetField(Field.TREE_NODE).Value = "Records";
&REC.GetField(Field.DESCR).Value = " ";
&REC.GetField(Field.RANGE_FROM).Value = " ";
&REC.GetField(Field.RANGE_TO).Value = " ";
&REC.GetField(Field.DYNAMIC_FLAG).Value = "N";
&REC.GetField(Field.ACTIVE_FLAG).Value = "Y";
&REC.GetField(Field.DISPLAY_OPTION).Value = "B";
&REC.GetField(Field.STYLECLASSNAME).Value = "PSHYPERLINK";
&REC.GetField(Field.PARENT_FLAG).Value = "X";
&REC.GetField(Field.TREE_LEVEL_NUM).Value = &PARENT_LEVEL + 1;
&int = &REC.GetField(Field.TREE_LEVEL_NUM).Value;
&REC.GetField(Field.LEVEL_OFFSET).Value = &LEVEL_OFFSET;

REM &ROW = &ROW + 1;
REM Warning " " | &ROW;
REM &MYSESSION = %Session;
REM &SRC_TREE = &MYSESSION.GetTree();
REM &PARENT_NODE = &SRC_TREE.FindNode(&PARENT_REC.GetField(Field.TREE_NODE).Value, "");

REM Warning " " | &PARENT_NODE;

REM Warning " " | &str;

REM &FIRST = True;
rem &sqlstmt = "SELECT A.RECNAME FROM PSRECDEFN A ,PSPROJECTITEM B WHERE A.RECNAME=B.OBJECTVALUE1 AND B.PROJECTNAME='EA_TEST'";
rem &NODE_ROWSET = &TREECTL.GetRow(2).GetRowset(1);
rem &PARENT_REC = &NODE_ROWSET.GetRow(&ROW).GetRecord(1);
REM Warning " " | &PARENT_REC;
&PARENT_LEVEL = &PARENT_REC.GetField(Field.TREE_LEVEL_NUM).Value;
rem &PARENT_LEVEL = &int + 1;
Warning " Records level is " | &PARENT_LEVEL;
&ROW = &ROW + 1;

&SQL = CreateSQL("SELECT OBJECTVALUE1 FROM %Table(PSPROJECTITEM) WHERE PROJECTNAME = 'ERPA_AK_AE_6' AND OBJECTTYPE=0");
rem &AAny = CreateArrayAny();
While &SQL.Fetch(&str)

REM &REC.GetField(Field.TREE_NODE).Value = "Fields";
&NODE_ROWSET.InsertRow(&ROW - 1);
&REC = &NODE_ROWSET.GetRow(&ROW).GetRecord(1);

REM Warning " " | &str;
&REC.GetField(Field.LEAF_FLAG).Value = "N";
&REC.GetField(Field.TREE_NODE).Value = &str;
&REC.GetField(Field.DESCR).Value = " ";
&REC.GetField(Field.RANGE_FROM).Value = "";
&REC.GetField(Field.RANGE_TO).Value = "";
&REC.GetField(Field.DYNAMIC_FLAG).Value = "N";
&REC.GetField(Field.ACTIVE_FLAG).Value = "Y";
&REC.GetField(Field.DISPLAY_OPTION).Value = "B";
&REC.GetField(Field.STYLECLASSNAME).Value = "PSHYPERLINK";
&REC.GetField(Field.PARENT_FLAG).Value = "N";
&REC.GetField(Field.TREE_LEVEL_NUM).Value = &int + 1;
&REC.GetField(Field.LEVEL_OFFSET).Value = 0;

&ROW = &ROW + 1;
Warning " " | &ROW;

End-While;
Warning "Cycle completed" | &ROW;
EA_DERIVED_HTML.HTMLAREA = GenerateTree(&TREECTL, EA_DERIVED_HTML.TREECTLEVENT);

End-If;

EA_DERIVED_HTML.TREECTLEVENT = "";
-------------------------End of the code-------------------------------------

Thanks in advance,
Ashok K.

Ashokkumar's picture
Ashokkumar (not verified)
Re: Peoplesoft HTML Area Issue

Can u send me the record structure of EA_TREECTL_NODE,EA_TREECTL_HDR