Hello,
I have:
version: SmartClient EE SNAPSHOT_v8.3d_2012-04-04
browser: Firefox 14.0.1 on Ubuntu 12.04 LTS
I am trying to invoke different screens from ui.xml folder, and add it as a member of a VLayout or canvas object. The problem I am facing is that I don't know how to remove the member object of a VLayout AFTER the listgrid loads up correctly.
It would be a good idea to have something like the following which calls an operationbinding and executes the callback, if success or failure, see the following code:
so my code follows:
JS code that loads up the emp.ui.xml
file: emp.ui.xml, notice that I have autoDraw="false" for DataView0, If I put it to true it covers whole screen so, the load of the screen works.
the source code of the smartclient original file
The main idea here is to combine SmartGWT and SmartClient, the way I was considering is to have the base on SmartGWT with Administration of users etc. and all other screens which contain the actual program that the general users. So, the smartclient screens will be loaded through Javascript from a menu table in MySQL.
So a way of adding new screens from R & D to production would be simply copying the DS and UI files into the respective folders and activate the menu by adding a record on the menu table.
a possible menu would be the following DS: menu_ds
I tried finding examples with RPCManager.loadScreen() however, a few exist in SmartGWT forums and none else (Documentation, Feature Explorer, Smartclient Forums.)
I hope I will get some help on this. Thanks in advance.
I have:
version: SmartClient EE SNAPSHOT_v8.3d_2012-04-04
browser: Firefox 14.0.1 on Ubuntu 12.04 LTS
I am trying to invoke different screens from ui.xml folder, and add it as a member of a VLayout or canvas object. The problem I am facing is that I don't know how to remove the member object of a VLayout AFTER the listgrid loads up correctly.
It would be a good idea to have something like the following which calls an operationbinding and executes the callback, if success or failure, see the following code:
Code:
isc.DMI.call({ appID: "builtinApplication", className: "com.something.test.server.servlet.logger", methodName: "doLogger", requestParams: { actionURL: "/test/sc/IDACall", containsCredentials: true, params : { } }, callback : function (response, data) { if (response.status == isc.RPCResponse.STATUS_SUCCESS) { alert("success"); alert(data); } else { alert("failed"); } } });
JS code that loads up the emp.ui.xml
Code:
function doit(CanvasToAddTo) { CanvasToAddTo.removeMembers(CanvasToAddTo.getMembers()); CanvasToAddTo.addMember(isc_DataView_0.getMembers()); } RPCManager.loadScreen("emp"); doit(VLayout0)
file: emp.ui.xml, notice that I have autoDraw="false" for DataView0, If I put it to true it covers whole screen so, the load of the screen works.
Code:
<DataSource> <loadID>test_employees</loadID> </DataSource> <ListGrid dataSource="marinos_employees" ID="ListGrid0" autoDraw="true"> <fields> <ListGridField name="payroll_id" title="Payroll"/> <ListGridField name="first_name" title="First Name"/> <ListGridField name="last_name" title="Last Name"/> <ListGridField name="skill" title="Skill"/> <ListGridField name="project_code" title="Project Code"/> <ListGridField name="car_transport" title="Car Transport"/> </fields> <listEndEditAction>next</listEndEditAction> <showFilterEditor>true</showFilterEditor> <canEdit>true</canEdit> <autoFetchData>true</autoFetchData> <canRemoveRecords>true</canRemoveRecords> </ListGrid> <DataView ID="DataView0" overflow="hidden" autoDraw="false"> <members><Canvas ref="ListGrid0"/> </members> <width>100%</width> <height>100%</height> </DataView>
the source code of the smartclient original file
Code:
isc.DataSource.create({ recordName:"employee", operationBindings:[ { operationType:"fetch", operationId:"fetchEmployeesNotInTeam" } ], serverType:"sql", testFileName:"/examples/shared/ds/test_data/employees.data.xml", titleField:"Name", ID:"employees", fields:[ { title:"userOrder", hidden:true, name:"userOrder", type:"integer", canEdit:false }, { title:"Name", name:"Name", length:128, type:"text" }, { title:"Employee ID", primaryKey:true, name:"EmployeeId", type:"integer", required:true }, { title:"Manager", detail:true, rootValue:"1", name:"ReportsTo", type:"integer", required:true, foreignKey:"employees.EmployeeId" }, { title:"Title", name:"Job", length:128, type:"text" }, { title:"Email", name:"Email", length:128, type:"text" }, { title:"Employee Type", name:"EmployeeType", length:40, type:"text" }, { title:"Status", name:"EmployeeStatus", length:40, type:"text" }, { title:"Salary", name:"Salary", type:"float" }, { title:"Org Unit", name:"OrgUnit", length:128, type:"text" }, { title:"Gender", valueMap:[ "male", "female" ], name:"Gender", length:7, type:"text" }, { title:"Marital Status", valueMap:[ "married", "single" ], name:"MaritalStatus", length:10, type:"text" } ] }) isc.ListGrid.create({ ID:"ListGrid1", autoDraw:false, dataSource:"employees", fields:[ { name:"Name", title:"Name" }, { name:"EmployeeId", title:"Employee ID" }, { name:"ReportsTo", title:"Manager" }, { name:"Job", title:"Title" }, { name:"Email", title:"Email" }, { name:"EmployeeType", title:"Employee Type" }, { name:"EmployeeStatus", title:"Status" }, { name:"Salary", title:"Salary" }, { name:"OrgUnit", title:"Org Unit" }, { name:"Gender", title:"Gender" }, { name:"MaritalStatus", title:"Marital Status" } ], autoFetchData:true }) isc.VLayout.create({ ID:"VLayout0", autoDraw:false, members:[ ListGrid1 ] }) isc.DataView.create({ ID:"DataView0", autoDraw:true, overflow:"hidden", members:[ VLayout0 ], width:"100%", height:"100%" })
The main idea here is to combine SmartGWT and SmartClient, the way I was considering is to have the base on SmartGWT with Administration of users etc. and all other screens which contain the actual program that the general users. So, the smartclient screens will be loaded through Javascript from a menu table in MySQL.
So a way of adding new screens from R & D to production would be simply copying the DS and UI files into the respective folders and activate the menu by adding a record on the menu table.
a possible menu would be the following DS: menu_ds
Code:
<DataSource ID="menu_ds" dataFormat="iscServer" serverType="sql" dataSourceVersion="1" dbName="Mysql" tableName="menu"> <fields> <field name="pk" type="integer" hidden="true" primaryKey="true"/> <field name="title" type="text" length="40"/> <field name="ui_name" type="text" length="40"/> <field name="onclick" type="text" length="255"/> <field name="hint" type="text" length="255"/> <field name="parent" type="text" required="false" hidden="true" foreignKey="menu.pk" rootValue="root"/> </fields> </DataSource>
I hope I will get some help on this. Thanks in advance.
Comment