
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.
In the Laptop UI explorer, expand the servapp development component.
Expand the nodes .
Double-click Component Controller .
Choose the Methods tab.
Choose New .
In the New Method wizard, create a method with the name fireQuery .
In the Methods tab, click fireQuery with the secondary mouse button and choose
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 } |