Skip to Content

The data which is displayed in the table is n't Refreshing

Hi All,

I have a Tree with recursive Node.The node values are coming from a RFC.On click of each node inside a Tree its calling a RFC to fill the Table Data.For each node RFC will be same but the input to RFC is different based on node selection.After selecting the 1st node i am able to display the data in the Table.But selecting the child node ,the table is displaying the same data as of 1st node's data.It should display different data in the Table according to selection of child node.Could you please help me in this case.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:49 PM

    Hi susmita

    It appears the parameter that you are passing or the RFC that you are calling is not changing , when you are selecting node.

    Please check this

    Regards

    Pratyush

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 02:23 PM

    Hi

    Thanks fro quick reply.Could youl please tell me the solution for this if input to RFC is not changing.Actually 1st i am selecting the root node,it is displaying the data in the table coming from RFC.After that i am expanding that node.On click of child node inside the root node it should display different data in the table.Under Tree i have two NodeType with name TreeNodeType1 and TreeNodeType2.onLoadChildren() property of 2 NodeType is calling the follwing methods.onActionTreeLevel1Display fro TreeNodeType1 and onActionTreeLevel2Display fro TreeNodeType2

    public void onActionTreeLevel1Display(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

    {

    //@@begin onActionTreeLevel1Display(ServerEvent)

    wdContext.currentZ_Mss_Org_Relat_Search_InputElement().setObjid(wdContext.currentOrganization_OutputElement().getOrg_Unit());

    wdThis.wdGetMatrixCompController().executeZ_Mss_Org_Relat_Search_Input();

    // Create a node of Organization Structure

    int MatrixSize = wdContext.nodeMss_Org_Unit().size();

    if(MatrixSize != 0)

    {

    for(int i=0;i<MatrixSize;i++)

    {

    IPrivateMatrixCompView.IMss_Org_UnitElement MatrixElementFromBapi = wdContext.nodeMss_Org_Unit().getMss_Org_UnitElementAt(i);

    IPrivateMatrixCompView.IOrg_Level1Node MatrixOrg_Level1Node = wdContext.nodeOrg_Level1();

    IPrivateMatrixCompView.IOrg_Level1Element MatrixOrg_Level = MatrixOrg_Level1Node.createOrg_Level1Element();

    MatrixOrg_Level.setId_Level11(MatrixElementFromBapi.getOrg_Desc());

    MatrixOrg_Level.setLevel1_Unit(MatrixElementFromBapi.getOrg_Unit());

    MatrixOrg_Level1Node.addElement(MatrixOrg_Level);

    }

    }

    //@@end

    }

    //@@begin javadoc:onActionTreeLevel2Display(ServerEvent)

    /** Declared validating event handler. */

    //@@end

    public void onActionTreeLevel2Display(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.matrixcomp.wdp.IPrivateMatrixCompView.IOrg_Level1Element element )

    {

    //@@begin onActionTreeLevel2Display(ServerEvent)

    wdComponentAPI.getMessageManager().reportSuccess("selectedval first line");

    try

    {

    if (element != null)

    {

    wdComponentAPI.getMessageManager().reportSuccess("selectedval-"+element.getLevel1_Unit());

    }

    else

    {

    wdComponentAPI.getMessageManager().reportSuccess("selectedval-null element");

    }

    /*

    // String str =wdContext.nodeOrg_Level1().getOrg_Level1ElementAt(row).getId_Level11();

    wdContext.currentZ_Mss_Org_Relat_Search_InputElement().setObjid(wdContext.nodeOrg_Level1().getOrg_Level1ElementAt(row).getLevel1_Unit());

    // wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(" success"+str );

    wdThis.wdGetMatrixCompController().executeZ_Mss_Org_Relat_Search_Input();

    // Create a node of Organization Structure

    int MatrixSize = wdContext.nodeMss_Org_Unit().size();

    if(MatrixSize != 0)

    {

    for(int i=0;i<MatrixSize;i++)

    { IPrivateMatrixCompView.IMss_Org_UnitElement MatrixElementFromBapi = wdContext.nodeMss_Org_Unit().getMss_Org_UnitElementAt(i);

    IPrivateMatrixCompView.IOrg_level2NodeNode MatrixOrg_Level2Node = wdContext.nodeOrg_level2Node();

    IPrivateMatrixCompView.IOrg_level2NodeElement MatrixOrg_Level2 = MatrixOrg_Level2Node.createOrg_level2NodeElement();

    MatrixOrg_Level2.setId_level2(MatrixElementFromBapi.getOrg_Desc());

    MatrixOrg_Level2Node.addElement(MatrixOrg_Level2);

    }

    }*/

    }

    catch(Exception e)

    {

    }

    Inside WdDoModigyView() I have written:----

    if (firstTime) {

    IWDTable table = (IWDTable) view.getElement("Detail_Table");

    wdContext.currentContextElement().setTableSorter(

    new TableSorter(table, wdThis.wdGetSortAction(), null));

    IWDTreeNodeType nodeType = (IWDTreeNodeType )view.getElement("TreeNodeType1");

    nodeType.mappingOfOnLoadChildren().addSourceMapping("path","element");

    nodeType.mappingOfOnAction().addSourceMapping("path","selectedElement");

    }

    and Inside wdInit() i have written:-

    try{

    // get the currently logged in user

    IWDClientUser wdUser = WDClientUser.getCurrentUser();

    // get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user

    IUser user = wdUser.getSAPUser();

    // check whether the user is anonymous

    if (user != null)

    {

    // access logon ID by iterating through the IUserAccount array

    IUserAccount[] acct = user.getUserAccounts();

    if(acct[0] != null)

    {

    String strUserid = acct[0].getLogonUid();

    // pass the value obtained from the portal to value attribute

    wdContext.currentZ_Mss_Org_Search_InputElement().setUsrid(new String(strUserid));

    wdThis.wdGetMatrixCompController().exeZ_Mss_Org_Search_Input();

    // get the model instance and disconnects it after executing provided the connection is alive

    OrganizationSearch myModel = (OrganizationSearch) WDModelFactory.getModelInstance(OrganizationSearch.class);

    myModel.disconnectIfAlive();

    }

    }

    }

    catch(Exception e)

    {

    wdComponentAPI.getMessageManager().reportException("Unable to get the Details. Please check the server logs. " ,true);

    e.printStackTrace();

    }

    // Set Visibility of Table and Structure

    wdContext.currentContextElement().setVisibility_Table(WDVisibility.BLANK);

    wdContext.currentContextElement().setVisibility_Structure(WDVisibility.VISIBLE);

    // Create a node of Organization Structure

    IPrivateMatrixCompView.IOrganizationalStructureNode MatrixNode = wdContext.nodeOrganizationalStructure();

    IPrivateMatrixCompView.IOrganizationalStructureElement Matrix = MatrixNode.createOrganizationalStructureElement();

    Matrix.setId(wdContext.currentOrganization_OutputElement().getOrg_Desc());

    MatrixNode.addElement(Matrix);

    // Setting Input of Matrix Display Bapi to output of Organization Search and execution of the Matrix Display Bapi for Table

    wdContext.currentZ_Mss_Matrix_Display_InputElement().setAct_Objid(wdContext.currentOrganization_OutputElement().getOrg_Unit());

    wdThis.wdGetMatrixCompController().exeZ_Mss_Matrix_Display_Input();

    // Set visibility and Default value of the Display Drop Down box\

    wdContext.currentContextElement().setVisibility_Display(WDVisibility.BLANK);

    wdContext.currentContextElement().setMatrix_DropDown("1");

    try{

    int MatrixSize = wdContext.nodeMatrix_Obj().size();

    if(MatrixSize != 0)

    {

    for(int i=0;i<MatrixSize;i++)

    {

    IPrivateMatrixCompView.IMatrix_ObjElement MatrixElementFromBapi = wdContext.nodeMatrix_Obj().getMatrix_ObjElementAt(i);

    IPrivateMatrixCompView.ICtx_MatrixOutputElement MatrixElement=wdContext.nodeCtx_MatrixOutput().createCtx_MatrixOutputElement();

    MatrixElement.setCtx_Assignment(MatrixElementFromBapi.getAssignment());

    MatrixElement.setCtx_CostCenter(MatrixElementFromBapi.getCost_Center());

    MatrixElement.setCtx_Job(MatrixElementFromBapi.getJob());

    MatrixElement.setCtx_Manager(MatrixElementFromBapi.getManager());

    MatrixElement.setCtx_Name(MatrixElementFromBapi.getName());

    MatrixElement.setCtx_OrgDesc(MatrixElementFromBapi.getOrg_Desc());

    MatrixElement.setCtx_Pernr(MatrixElementFromBapi.getPernr());

    MatrixElement.setCtx_Persa(MatrixElementFromBapi.getPersa());

    MatrixElement.setCtx_Persb(MatrixElementFromBapi.getPersb());

    MatrixElement.setCtx_Position(MatrixElementFromBapi.getPosition());

    MatrixElement.setCtx_StaffingRatio(MatrixElementFromBapi.getStaff().toString());

    wdContext.nodeCtx_MatrixOutput().addElement(MatrixElement);

    }}}

    catch(Exception ex)

    {

    wdThis.wdGetAPI().getComponent().getMessageManager().reportException("Unable to get the Matrix Information. Please check the server logs. ",true);

    ex.printStackTrace();

    }

    Could you please tell me any error on thsi code.

    I have an doubt onLoadChild() property of both the NodeType is correct or not?

    Thanks & Regards

    Susmita

    Add comment
    10|10000 characters needed characters exceeded