SmartClient Version: SC_SNAPSHOT-2010-08-03/EVAL Deployment (expires 2010.10.02_09.35.33) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
Hi,
When I call my custom operation, the changed values are not in the Map given to the operation.
Initial data is fetched, I then add a conditionValue on one of the condition items (contained in a listgrid); I then click search which calls the custom operation.
If I do the same, but call the save operation instead of my custom operation, I have the same problem, the changed values are not coming trough!!!
Custom operation on the serverObject:
Client code
ds.xml
the traces from the DEV Console where > 20 kb, so I am unable to post these as attachments
Hi,
When I call my custom operation, the changed values are not in the Map given to the operation.
Initial data is fetched, I then add a conditionValue on one of the condition items (contained in a listgrid); I then click search which calls the custom operation.
If I do the same, but call the save operation instead of my custom operation, I have the same problem, the changed values are not coming trough!!!
Custom operation on the serverObject:
Code:
public DSResponse performSearch(DSRequest dsRequest, Map record) throws Exception { ... }
Code:
valueMgr = new ValuesManager(); this.setValuesManager(valueMgr); valueMgr.setDataSource(ds); selection = new DynamicForm(); selection.setWidth("50%"); selection.setHeight(250); selection.setNumCols(4); selection.setValuesManager(valueMgr); selection.setDataPath(SearchSessDTOFields.SELECTION); selection.setDataSource(SilkDataSourceNames.SELECTION); conditions = new ListGrid(); conditions.setWidth("50%"); conditions.setHeight(250); conditions.setValuesManager(valueMgr); conditions.setDataPath(SearchSessDTOFields.CONDITIONITEMS); conditions.setDataSource(SilkDataSourceNames.CONDITIONITEMS); conditions.setAutoFetchData(false); conditions.setCanEdit(true); conditions.setSaveByCell(false); conditions.setAutoSaveEdits(false); conditions.setSelectOnEdit(true); displayitems = new ListGrid(); displayitems.setVisible(false); displayitems.setValuesManager(valueMgr); displayitems.setDataPath(SearchSessDTOFields.DISPLAYITEMS); displayitems.setDataSource(SilkDataSourceNames.DISPLAYITEM); displayitems.setAutoFetchData(false); displayitems.setCanEdit(true); displayitems.setSaveByCell(false); displayitems.setAutoSaveEdits(false); displayitems.setSelectOnEdit(true); ... public void onClick(ClickEvent event) { ... if(tooltip.equals("Save")){ valueMgr.saveData(); } else if(tooltip.equals("Search")){ executeOperation(ISearchOutpost.performSearch); } } private void executeOperation(final String operationId) { DSRequest requestProperties = new DSRequest(); Record record = new Record(JSOHelper.convertMapToJavascriptObject(valueMgr.getValues())); datasource.performCustomOperation(operationId, record, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { //clear previous values searchResult.setData(new ListGridRecord[0]); JavaScriptObject resultSet = (JavaScriptObject) rawData; searchResult.setData(Record.convertToRecordArray(resultSet)); // searchResult.redraw(); } }, requestProperties); }
Code:
<DataSource ID="SearchSessDTO" dropExtraFields="true"> <fields> <field name="selection" type="93" javaClass="outpost.dto.selection.SelectionDTO" multiple="true" /> <field name="conditionItems" type="92" javaClass="outpost.dto.selection.ConditionItemDTO" multiple="true" /> <field name="displayItems" type="91" javaClass="outpost.dto.selection.DisplayItemDTO" multiple="true" /> </fields> <serverObject ID="SearchSessStore" lookupStyle="new" className="server.stores.search.SearchSessStore"/> <operationBindings> <binding operationId="ISearchOutpost.performSearch" operationType="custom" serverMethod="performSearch"/> <binding operationId="ISearchOutpost.generateNewInstance" operationType="fetch" serverMethod="generateNewInstance"/> </operationBindings> </DataSource>
Comment