Hi,
I'm not only new to SmartGWT, but to GWT also. I'm trying to make a simple application. The source XML is similar to the following:
As you can see, there are multiple "input" nodes for each "process" node. I want to display the following values in the main ListGrid:
Process ID | Process Name | Process Group
When a row is selected in the Grid, I have another ListGrid below the main Grid. This second list has only one column, which will list the "input" values for the selected Process ID.
I did the mapping like this:
The code that populates the "input" Grid is:
The problem is obviously that I'm getting all the "input" values separated by commas in a single text field. I would like to get the values in a List or an Array so that they can be displayed in a separate ListGrid.
I need some help in getting the multiple input elements from the XML and display them as a list.
Thanks.
I'm not only new to SmartGWT, but to GWT also. I'm trying to make a simple application. The source XML is similar to the following:
Code:
<List> <process> <process-id>4.1</process-id> <process-name>Develop Project Charter</process-name> <process-group>Initiating</process-group> <input>Project Statement of Work</input> <input>Business Case</input> <input>Contract</input> </process> </List>
Process ID | Process Name | Process Group
When a row is selected in the Grid, I have another ListGrid below the main Grid. This second list has only one column, which will list the "input" values for the selected Process ID.
I did the mapping like this:
Code:
setRecordXPath("/List/process"); DataSourceTextField processNameField = new DataSourceTextField("process-name", "Process Name", 128); DataSourceTextField processIdField = new DataSourceTextField("process-id", "Process ID", 128); DataSourceTextField procGrpField = new DataSourceTextField("process-group", "Process Group", 128); DataSourceTextField inputField = new DataSourceTextField("input", "Input(s)", 128);
Code:
mainGrid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent event) { inputGrid.setData(mainGrid.getSelection()); }
I need some help in getting the multiple input elements from the XML and display them as a list.
Thanks.
Comment