COM/MTS Guide - Prolifics
COM/MTS Guide - Prolifics
COM/MTS Guide - Prolifics
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Sample Client Screens(Constants.PR_CURRENT_<strong>COM</strong>PONENT_SYSTEM,Constants.PV_SERVER_<strong>COM</strong>);id1.itofield(a);}id.itofield(cFuncs.sm_obj_create("cStrings"));public void screenExit(ScreenInterface s, int context){CFunctionsInterface cFuncs = s.getCFunctions();FieldInterface id = s.getField("id");cFuncs.sm_obj_delete_id(id.intval());A button event handler for the Search push button calls the method and gets the numberof returned rows. The push button calling this event handler has a Java Tag ofSearchButtonHandler.import com.prolifics.jni.*;public class SearchButtonHandler extends ButtonHandlerAdapter{}public int buttonValidate(FieldInterface f, int item, int context){ScreenInterface s = f.getScreen();FieldInterface idField = s.getField("id");FieldInterface rowField = s.getField("RowCount");FieldInterface searchField = s.getField("search");FieldInterfacecompanyNameField = s.getField("CompanyName");CFunctionsInterface cFuncs = f.getCFunctions();companyNameField.putfield(1,searchField.getfield());int id = idField.intval();String i = cFuncs.sm_obj_call("(" + id + ",'GetCustomer',CompanyName,CustomerID,Phone)");String st = cFuncs.sm_obj_get_property( id, "RowCount");rowField.putfield(st);return id;}For more information about Java event handlers, refer to Chapter 21, “Java EventHandlers and Objects,” in Application Development <strong>Guide</strong>.<strong>COM</strong>/<strong>MTS</strong> <strong>Guide</strong> 4-9