Hi,
Can you point me to documentation for upgrade steps from 3.1 to 4.1 (LGPL)?
Thanks.
Can you point me to documentation for upgrade steps from 3.1 to 4.1 (LGPL)?
Thanks.
getValues()
NOTE: this is used only in the very rare case that a form is used to submit data directly to a URL. Normal server contact is through RPCManager.
isc.VLayout.create({
ID:"mainPageLayout",
autoDraw:true,
width:"100%",
height:"100%",
members:[
isc.DynamicForm.create({
titleSuffix:"",
requiredTitleSuffix:" <span style=\"color: red;\">*</span>",
requiredTitlePrefix:"",
titleAlign:"left",
fields:[
{
title:"Single Line of Text",
type:"text",
value:"Text Value",
name:"singleLineOfText",
titleHover:function (item, form) {
alert('Title Hover');
return true;
}
}
]
})
]
});
package com.smartgwttest.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.shared.GWT;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.types.DSProtocol;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
import com.smartgwt.client.widgets.layout.VLayout;
public class Entry implements EntryPoint {
private VLayout contentPanel;
private DynamicForm dynamicForm;
private ComboBoxItem comboBoxItem;
@Override
public void onModuleLoad() {
getContentPanel().draw();
}
private VLayout getContentPanel() {
if (contentPanel == null) {
contentPanel = new VLayout();
contentPanel.setHeight100();
contentPanel.setWidth100();
contentPanel.setMembersMargin(10);
contentPanel.addMembers(getDynamicForm());
}
return contentPanel;
}
public DynamicForm getDynamicForm() {
if (dynamicForm == null) {
dynamicForm = new DynamicForm();
dynamicForm.setItems(getComboBoxItem());
}
return this.dynamicForm;
}
public ComboBoxItem getComboBoxItem() {
if (comboBoxItem == null) {
comboBoxItem = new ComboBoxItem();
comboBoxItem.setValueField("id");
comboBoxItem.setDisplayField("name");
comboBoxItem.setTitle("Test Combo Box");
comboBoxItem.setAddUnknownValues(true);
comboBoxItem.setCompleteOnTab(false);
comboBoxItem.setOptionDataSource(new ComboDataSource());
}
return this.comboBoxItem;
}
static class ComboDataSource extends DataSource {
public ComboDataSource() {
setDataProtocol(DSProtocol.CLIENTCUSTOM);
DataSourceIntegerField id = new DataSourceIntegerField("id");
DataSourceTextField name = new DataSourceTextField("name");
setFields(id, name);
}
@Override
protected Object transformRequest(DSRequest dsRequest) {
Criteria criteria = dsRequest.getCriteria();
GWT.log("id: " + criteria.getAttribute("id") + ", name: " + criteria.getAttribute("name"));
return dsRequest;
}
}
}
id: test, name: null
id: null, name: Loading...
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
.diagInfo {
font-size: 14px;
font-weight: bold;
padding: 5px;
}
</style>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Core.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Foundation.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Containers.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Grids.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Forms.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_DataBinding.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Drawing.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_PluginBridges.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Charts.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Tools.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
<script type="text/javascript" >
var isomorphicDir="http://localhost:8080/isomorphic/";
// set this to the correct JIRA ticket
var jiraTicket = "SNQA-431";
// test data
var data = [
{ inspections: 32, project: { title: "ABC Project"} },
{ inspections: 14, project: { title: "Joe's Crab Shack"} },
{ inspections: 0, project: { title: "Pizza Hut"} },
{ inspections: 2, project: { title: "Home Depot"} }
];
// datasource for the grid
isc.DataSource.create({
ID: "ds",
fields: [
{name:"title", title:"Project Title", valueXPath: "project/title"},
{name:"inspections", type:"integer", title:"Inspection Counts"}
],
cacheData:data,
clientOnly: true
});
// once page loads set some diagnostic information
isc.Page.setEvent("load", function() {
document.title = jiraTicket + " (SmartClient version " + isc.versionNumber + ")";
var html = [];
html.push("Jira: " + jiraTicket);
html.push("SmartClient: " + isc.versionNumber);
html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
diagLabel.setContents( html.join("<br>"));
});
</script>
</head>
<body>
<script>
// this laebl should not be removed, all test cases should have this
var diagLabel = isc.Label.create({
ID: "diagInfo",
width: "100%",
styleName: "diagInfo",
autoFit: true
});
// basic grid
var grid = isc.ListGrid.create({
dataSource: ds,
dataFetchMode : "local",
autoFetchData: true,
clientOnly: true,
position: "relative",
width : "100%",
align : "center",
autoFitData : "vertical",
autoFitMaxHeight : 400,
alternateRecordStyles : true,
canAddFormulaFields : true,
canAddSummaryFields : true,
canGroupBy : true,
canReorderFields : true,
showGroupSummary : true,
groupByMaxRecords : 15,
useAdvancedFieldPicker: true,
advancedFieldPickerThreshold: 5,
autoDraw: false
});
// the main page layout - place all other components afetr diagLabel
isc.VLayout.create({
width:"100%",
membersMargin: 20,
members: [
// this must remain here to output diagnostic information
diagLabel,
// add any other components here
grid
]
});
</script>
</body>
</html>
this.myListGrid.setDataSource( DataSource.get("mydatasource") );
final Map< String, String > icons= new HashMap< String, String >();
icons.put( "1", "../images/check-icon.png" );
final ListGridField fieldEnabled= this.myListGrid.getField( "enabledField" );
fieldEnabled.setValueIcons(icons);
fieldEnabled.setShowValueIconOnly(true);
# -------------- REAL TIME MESSAGING SETTINGS --------------
# how often do we send keepalives to the client (ms)
messaging.keepaliveInterval: 3000
# how long the client waits after the keepaliveInterval before re-establishing
# the connection (ms)
messaging.keepaliveReestablishDelay: 1000
# how long the client waits for the connect handshake to complete before
# retrying
messaging.connectTimeout: 4000
# connection time to live - the maximum amount of time a persistent connection
# is allowed to stay open before being re-established (ms)
messaging.connectionTTL: 120000
# total response size to pad out to in order to defeat intervening
# bufferring by proxies (bytes)
messaging.flushBufferSize: 8096
# dispatcher to use for user registration/message queueing
# com.isomorphic.messaging.LocalMessageDispatcher for simple one-jvm messaging
# com.isomorphic.messaging.JMSMessageDispatcher for JMS-backed messaging
# Isomorphic recommends developing using a single container with the
# LocalMessageDispatcher and then switching to the JMSMessageDispatcher for production.
messaging.dispatcherImplementer: com.isomorphic.messaging.JMSMessageDispatcher
# jms configuration - for JMSMessageDispatcher only
messaging.jms.context: _container_
messaging.jms.jndiPrefix: jms
messaging.jms.topicConnectionFactory: fooBarConnectionFactory
<Resource auth="Container"
name="jms/fooBarConnectionFactory"
type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://localhost:41616"
brokerName="ActiveMQBroker"
/>
<field name="deleted_url" type="link" title="Link to cause for deletion" tableName="deleted_reference" nativeName="url" />
<field name="approval_url" type="link" title="Link to approval document" tableName="archive_reference" nativeName="url" />
/**
* Return the value tracked by this form item.
*
* @return value of this element
*/
public native Float getValueAsFloat() /*-{
var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
var ret;
if(self.setValue) {
ret = self.getValue();
} else {
ret = self.value;
}
if(ret==null) return null;
return @com.smartgwt.client.util.JSOHelper::toFloat(F)(ret);
}-*/;
//isc_RPCResponseStart-->[{affectedRows:0,data:[{project:{title:"ABC Inc."},inspections:16,observations:298},{project:{title:"Pizza Tent"},inspections:1,observations:5},{project:{title:"Wally World"},inspections:234,observations:2}],invalidateCache:false,isDSResponse:true,operationType:"fetch",queueStatus:0,status:0,total:3}]//isc_RPCResponseEnd
//isc_RPCResponseStart-->[{data:[{projectTitle:"ABC Inc.",project:{title:"ABC Inc."},inspections:16,observations:298},{projectTitle:"Pizza Tent",project:{title:"Pizza Tent"},inspections:1,observations:5},{projectTitle:"Wally World",project:{title:"Wally World"},inspections:234,observations:2}],invalidateCache:false,isDSResponse:true,operationType:"fetch",queueStatus:0,status:0,total:3}]//isc_RPCResponseEnd
<DataSource
ID="dsSNQA431"
serverConstructor="SNQA431Datasource">
<fields>
<field name="inspections" type="integer" />
<field name="observations" type="integer" />
<field name="projectTitle" type="text" valueXPath="project/title"/>
</fields>
</DataSource>
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.isomorphic.datasource.BasicDataSource;
import com.isomorphic.datasource.DSRequest;
import com.isomorphic.datasource.DSResponse;
public class SNQA431Datasource extends BasicDataSource
{
@Override
public DSResponse executeFetch( DSRequest req ) throws Exception
{
DSResponse response = new DSResponse();
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put( "project", new Project( "ABC Inc." ) );
resultMap.put( "inspections", 16 );
resultMap.put( "observations", 298 );
resultList.add( resultMap );
resultMap = new HashMap<String, Object>();
resultMap.put( "project", new Project( "Pizza Tent" ) );
resultMap.put( "inspections", 1 );
resultMap.put( "observations", 5 );
resultList.add( resultMap );
resultMap = new HashMap<String, Object>();
resultMap.put( "project", new Project( "Wally World" ) );
resultMap.put( "inspections", 234 );
resultMap.put( "observations", 2 );
resultList.add( resultMap );
response.setProperty( "total", resultList.size() );
response.setData( resultList );
return response;
}
}
public class Project {
private String title;
public Project() {};
public Project(String title) {
this.title = title;
}
public String getTitle()
{
return title;
}
public void setTitle( String title )
{
this.title = title;
}
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
.diagInfo {
font-size: 14px;
font-weight: bold;
padding: 5px;
}
</style>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Core.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Foundation.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Containers.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Grids.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Forms.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_DataBinding.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Drawing.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_PluginBridges.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Charts.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
<script src="http://localhost:8080/isomorphic/DataSourceLoader?dataSource=dsSNQA431"></script>
<script type="text/javascript" >
var isomorphicDir="http://localhost:8080/isomorphic/";
var ds = null;
// set this to the correct JIRA ticket
var jiraTicket = "SNQA-431";
// once page loads set some diagnostic information
isc.Page.setEvent("load", function() {
document.title = jiraTicket + " (SmartClient version " + isc.versionNumber + ")";
var html = [];
html.push("Jira: " + jiraTicket);
html.push("SmartClient: " + isc.versionNumber);
html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
diagLabel.setContents( html.join("<br>"));
});
</script>
</head>
<body>
<script>
// this laebl should not be removed, all test cases should have this
var diagLabel = isc.Label.create({
ID: "diagInfo",
width: "100%",
styleName: "diagInfo",
autoFit: true
});
// basic grid
var grid = isc.ListGrid.create({
autoFetchData: true,
position: "relative",
dataSource: "dsSNQA431",
width : "100%",
align : "center",
autoFitData : "vertical",
autoFitMaxHeight : 400,
alternateRecordStyles : true,
canAddFormulaFields : true,
canAddSummaryFields : true,
canGroupBy : true,
canReorderFields : true,
showGroupSummary : true,
groupByMaxRecords : 15,
useAdvancedFieldPicker: true,
advancedFieldPickerThreshold: 5,
autoDraw: false
});
// the main page layout - place all other components afetr diagLabel
isc.VLayout.create({
width:"100%",
membersMargin: 20,
members: [
// this must remain here to output diagnostic information
diagLabel,
// add any other components here
grid
]
});
grid.fetchData();
</script>
</body>
</html>
setID(id);
setRecordXPath("/List/d");
DataSourceIntegerField pkField = new DataSourceIntegerField("id");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
addField(pkField);
DataSourceTextField countryCodeField = new DataSourceTextField("n", "Master");
countryCodeField.setRequired(true);
addField(countryCodeField);
DataSourceTextField traits = new DataSourceTextField("e", "Detail");
traits.setChildrenProperty(true);
traits.setMultiple(true);
traits.setForeignKey("DetailDS.id");
traits.setDisplayField("n");
addField(traits);
setDataURL("Master.data.xml");
setClientOnly(true);
setID(id);
setRecordXPath("/List/t");
DataSourceIntegerField pkField = new DataSourceIntegerField("id");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
addField(pkField);
DataSourceTextField nameField = new DataSourceTextField("n", "Name");
nameField.setRequired(true);
addField(nameField);
setDataURL("Detail.data.xml");
setClientOnly(true);
@Override
public void onModuleLoad() {
final ListGrid listGrid = new ListGrid();
listGrid.setDataSource(MasterDS.getInstance());
listGrid.setWidth(1200);
listGrid.setHeight(600);;
listGrid.setShowFilterEditor(true);
listGrid.setUseAdvancedFieldPicker(true);
listGrid.setAlternateRecordStyles(true);
listGrid.setAutoFetchData(true);
listGrid.setCanEdit(false);
listGrid.setCanRemoveRecords(false);
listGrid.setCanMultiSort(true);
listGrid.setShowFilterEditor(true);
ListGridField detailField = new ListGridField("e", "Detail");
detailField.setOptionDataSource(DetailDS.getInstance());
detailField.setMultiple(true);
detailField.setDisplayField("n");
detailField.setValueField("id");
detailField.setAutoFetchDisplayMap(true);
detailField.setSortByDisplayField(true);
final FilterBuilder filterBuilder = new FilterBuilder();
filterBuilder.setDataSource(MasterDS.getInstance());
ListGridField nameField = new ListGridField("n", "Master");
nameField.setWidth(200);
listGrid.setFields(nameField, detailField);
VLayout layout = new VLayout(15);
IButton filterButton = new IButton("Filter");
filterButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid.filterData(filterBuilder.getCriteria());
}
});
layout.addMember(filterBuilder);
layout.addMember(filterButton);
layout.addMember(listGrid);
layout.draw();
}
criteria:[
{
fieldName:"e",
operator:"inSet",
value:[
3,
2
]
}
]
criteria:[
{
operator:"inSet",
fieldName:"e",
value:[
null,
null
]
}
]