Hi,
I am trying to show a custom dialog, on click on menu. In Dialog, I am trying to display a grid with results from a DQL in a grid. My custom dialog is opening, but I am facing difficulty with displaying the DQL results in grid. Below is the code I am using, I tried adding the query results to defaultvalues, but grid is always display without any row data. Any advice on how to add the rows data to grid?
@Override
public XmlNode buildDialog(D2fsContext context, List<Attribute> attributes) throws Exception {
XmlNode configDialog = XmlUtil.loadFromURL(context.getXmlDialogFile()).getRootXmlNode();
DialogProcessor dialogProcessor = new DialogProcessor(context, configDialog);
dialogProcessor.setLabelsBundle(context.getDialogBundle());
Map<String, String> defaultValues = new HashMap<>();
// in collection
{
defaultValues.put("r_object_id", col.getString("r_object_id"));
defaultValues.put("object_name", col.getString("object_name"));
defaultValues.put("record_class", col.getString("record_class"));
}
dialogProcessor.setDefaultValues(defaultValues);
XmlNode dialogNode = dialogProcessor.getDialog();
return dialogNode;
}
My custom dialog xml:
.....
<grid id="griditesm" grid_height="400" >
<label id="r_object_id" condition_visible="false" />
<label id="object_name" />
<label id="record_class"/>
</grid>
....
Thanks!
Pankaj