Show TOC

Defining the Method for Calling the QueryLocate this document in the navigation structure

Use

In the tutorial application, you have to define a method that calls the query. In this method, you have to obtain the ID of the selected customer and provide this value to the composite class. You then have to call the query class.

Procedure
  1. In the Laptop UI explorer, expand the servapp development component.

  2. Expand the nodes Start of the navigation path Web Dynpro Next navigation step Components  Next navigation step  CustomerComp End of the navigation path.

  3. Double-click Component Controller .

  4. Choose the Methods tab.

  5. Choose New .

  6. In the New Method wizard, create a method with the name fireQuery .

  7. In the Methods tab, click fireQuery with the secondary mouse button and choose Start of the navigation path Navigate to  Next navigation step Implementation. End of the navigation path

  8. Enter the following code:

fireQuery method

public void fireQuery()

{

//@@begin fireQuery()

int Sel = wdContext.nodeCUSTOMERS_CUSTOMERHEADER().getLeadSelection();

if (Sel > -1)

{

Qid = wdContext.nodeCUSTOMERS_CUSTOMERHEADER(). getCUSTOMERS_CUSTOMERHEADERElementAt(Sel).getCUSTOMERID();

SQ.getQueryInput().setCUSTOMERID(Qid);

}

try {

SQ.execute();

} catch (CMIException e) {

e.printStackTrace();

}

wdContext.nodeQueryResult().invalidate();

//@@end

}