Show TOC Start of Content Area

Procedure documentation Supplying the Context with Data Locate the document in its SAP Library structure

Use

You have to supply the business graphic’s context with data. You can do this in the wdDoInit method (or in a supply function) in the controller.

For more information read the documentation on the supply function.

 

Procedure

To generate the coding for the implementation of the controller click the button Implementation.

Enter the following coding in the method wdDoInit. Make sure you enter the coding in the user coding area, that is, between the characters //@@begin wdDoInit()and //@@end.

//@@begin javadoc:wdDoInit()

/** Hook method called to initialize controller. */

//@@end

public void wdDoInit()

{

  //@@begin wdDoInit()

 

  IPrivateSimpleGraphicsView.ICategoriesElement categoryElement;

  for (int i = 0; i < 10; i++) {

    categoryElement = wdContext.createCategoriesElement();

    categoryElement.setCategoryText("C" + i);

    categoryElement.setSeries1Value(i);

    categoryElement.setSeries2Value(10 - i);

    wdContext.nodeCategories().addElement(categoryElement);

  }

 

  //@@end

}

 

Result

You have now implemented the method wdDoInit. It fills the context with data when the controller is initialized.

  

  

End of Content Area