How can I open a form in a modal window, and read the values of the components present on the form.


To open a form you should use the following code:

//Create the window
dataweb.client.Window wnd = new dataweb.client.Window(dataweb.client.Window.DIALOG_MODAL,thisForm.getContainer());

//Open the form
dataweb.client.components.Form frm = client.openForm(session, "<package>.<form>" ,wnd ,thisForm);

//Show the window (since the window is modal waits until it is closed);

//Reads the value of the components of the form
String val = frm.getComponent("textBox2").getText();

//Destroy the window and the form

Published in Fri, 10 December 2010 17:38