hello all
i want to perform some procedure
client side
Button btn = new Button(); btn.setAutoFit(true); btn.setTitle("Delete"); btn.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { try { DataSource dataSource = DataSource.get("testDS"); DSRequest dsRequest = new DSRequest(); dsRequest.setOperationId("getTest"); Criteria criteria = new Criteria(); criteria.setAttribute("SERVICE_ID", 200); dataSource.fetchData(null, new DSCallback() { @SuppressWarnings("rawtypes") @Override public void execute(DSResponse response, Object rawData, DSRequest request) { try { // Record record = response.getData()[0]; // String aaaa = record.getAttributeAsString("SIM_CARD_NAME"); } catch (Exception e) { SC.say(e.toString()); } } }, dsRequest); } catch (Exception e) { e.printStackTrace(); SC.say(e.toString()); } } }); server side
<DataSource ID="testDS" serverType="sql"> <operationBindings> <operationBinding operationType="fetch" operationId="getTest"> <customSQL> call test_ika(205024) </customSQL> </operationBinding> </operationBindings> </DataSource> procedure is calling twice and then i getting following error : Cannot perform fetch on a PLSQL statement: next please help me why procedure in calling twice or i getting error?
Announcement
Collapse
No announcement yet.
X
-
You may want to read the QuickStart guide, it really helps to understand the concepts
Leave a comment:
-
listGridRecord.getAttribute("nameOfYourAttribute")
Why aren't you you using getAttribute() ?
Leave a comment:
-
hello
final ListGrid grid = new ListGrid();
grid.addSelectionUpdatedHandler(new SelectionUpdatedHandler() { @Override public void onSelectionUpdated(SelectionUpdatedEvent selectionUpdatedEvent) { ListGridRecord listGridRecord = grid.getSelectedRecords()[1]; SC.say(listGridRecord.getSingleCellValue()); } }); i'm getting null with getSingleCellValue() can someone write little code to get value from selected row?
Leave a comment:
-
You only need setDataSource if you are directly getting the data from your datasource.
In Blamas example, you set "myGrid.setData(..)" so you don't need "setDataSource()": you already got the data and you are setting it directly.
Inside the execute method, you can do whatever you want with your data. Your data is here. "response.getData()" as an array of records.
So, for example, for setting the label text:
Code:Label myLabel = new Label(); DataSource.get("testDS").fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { label.setTitle(response.getData()[0].getAttribute("myAttribute")); } });
Leave a comment:
-
before
myGrid.fetchData(null, null, new DSRequest() { { setOperationId("getTest"); } }); i must write myGrid.setDataSource() right? and how about if i want to apply result of dataSource to "label" component?
Leave a comment:
-
Hi irakli81,
you are using:
Code:final ListGrid myGrid = new ListGrid(); DataSource.get("testDS").fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { myGrid.setData(response.getData()); } });
UseCode:myGrid.fetchData(null, null, new DSRequest() { { setOperationId("getTest"); } });
Best regards
Blama
Leave a comment:
-
i want to get data into listGrid
final ListGrid myGrid =new ListGrid(); DataSource.get("testDS").fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { myGrid.setData(response.getData()); } });
<DataSource ID="testDS" tableName="test_table" serverType="sql" qualifyColumnNames="false" dropExtraFields="false"> <fields> <field name="test" type="text" /> <field name="test2" type="text" /> </fields> <operationBindings> <operationBinding operationType="fetch" operationId="getTest"> <selectClause><![CDATA[ t.test,t.test2 ]]> </selectClause> <tableClause><![CDATA[ soo.test_table t ]]> </tableClause> <whereClause><![CDATA[ t.test=$criteria.test ]]> </whereClause> </operationBinding> <!--<operationBinding operationType="fetch" operationId="exportProblematicPhones" serverMethod="testMethod">--> <!--<serverObject lookupStyle="new" className="ge.magticom.testGwtGwt.server.dmi.DMITest" />--> <!--</operationBinding>--> </operationBindings> </DataSource>
i getting this error
The type new DSCallback(){} must implement the inherited abstract method DSCallback.execute(DSResponse, Object, DSRequest) what i doing incorrect? and there isn't needed to specify operationId="getTest"?
Leave a comment:
-
sorry it wasn't correct question and i found answer on this what i needed
Leave a comment:
-
thank you
and one more question please
if data is empty in SelectItem how to hide scroll in it?
Leave a comment:
-
DataSource default value
hello
i have dropdown
final SelectItem ServiceItem = new SelectItem(); ServiceItem.setName("services"); ServiceItem.setWidth(350); ServiceItem.setTitle("მომსახურების სახე"); ServiceItem.setOptionDataSource(DataSource.get("serviceDS")); ServiceItem.setOptionOperationId("getServices"); ServiceItem.setValueField("service_id"); ServiceItem.setDisplayField("service_name"); ServiceItem.setAutoFetchData(true); ServiceItem.setDefaultToFirstOption(true); how can i take default value of ServiceItem? after onChanged i can take value but before onChanged i can not take default value.
Tags: None
Leave a comment: