Quantcast
Channel: SmartClient Forums
Viewing all 4756 articles
Browse latest View live

Upgrade steps from 3.1 to 4.1 (LGPL)

$
0
0
Hi,

Can you point me to documentation for upgrade steps from 3.1 to 4.1 (LGPL)?

Thanks.

How to work with several DynamicForm in one page

$
0
0
Hey,

I'm using SmartClient_v91p_2014-03-23_PowerEdition.

I need to create page layout that can hold several DynamicForms in various locations. This is why I will need to gather the values dynamically with
Code:

getValues()
and then submit it. I would like to send the data to a certain class for processing. In DynamicForm.action document you state
Code:

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.
so my question is how should I use the RPCManager in this context?

Thank you.

titleHover of FormItem doesn't work

$
0
0
Hello,

I'm using SmartClient_v91p_2014-03-23_PowerEdition and when I try to use titleHover it doesn't work, valueHover doesn't work either only itemHover works but I need an hover on the title.

Here is a reproduce scenario:

Code:

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;
                }
              }
            ]

          })

        ]

      });

BTW, if I add titleHover in your Featured Samples it also doesn't work. Thank you.

ComboBox fetch missing values bug

$
0
0
The combobox is mounting the "fetch missing values" criteria wrong, it's trying to filter for the value field using the typed value.

Sample:
Code:

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;
        }

    }

}

The console output is someting like this:
Code:

id: test, name: null
id: null, name: Loading...

To reproduce the bug type something in the combobox then quickly press tab.

SmartClient Version: v9.1p_2014-03-30/LGPL Development Only (built 2014-03-30)
GWT: 2.6.0
Browser: Chromium 33.0.1750.152

Am I doing something wrong?

BUG in drag from menu action in the Feature Explorer example (9.1 KO 9.0 OK)

$
0
0
SmartClient Version: v9.1p_2014-03-10/LGPL Deployment (built 2014-03-10)

Browsers: Tested on Chrome(33), FF(27), IE(11)
OS: Win7 OS

Sample code: http://www.smartclient.com/docs/9.1/a/system/reference/SmartClient_Explorer.html#DDdragMenu

Description:
After changing the smartclient version from my project from 9.0 to 9.1, a drag & drop feature from a Menu that my project includes doesn't work any more...

After debugging (No JS exceptions are reported and smartclient console is clean) I've noticed that in the feature explorer site for the 9.1 version (http://www.smartclient.com/docs/9.1/a/system/reference/SmartClient_Explorer.html#DDdragMenu) the example is not working correctly as in the previous version (http://www.smartclient.com/docs/9.0/a/system/reference/SmartClient_Explorer.html#DDdragMenu).

Best regards....

need help for refreshing one record of ListGrid at client

$
0
0
Hello!

SmartClient Version: v9.1p_2014-03-20/PowerEdition Deployment (built 2014-03-20)
GWT 2.5.1
IE-11

I want to refresh one record of listgrid at client

my code like below:

void refreshData(Record record){
//get the old data of listgrid
RecordList recordList=getDataAsRecordList();
//find the data position that need change
int pos=recordList.findIndex("RECORDTIMESTAMP",record. getAttribute("RECORDTIMESTAMP"));
//remove the data
recordList.removeAt(pos);
//add the new data
recordList.addAt(record, pos);
//refresh data
setData(recordList);
}

But it is not work.Can you help me to resolve this problem? thank you!

valueXPath help

$
0
0
I seem to be missing something small here, but I cannot figure out why the valueXPath is not working:

Code:

<!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>

ListGrid getField or setFieldTitle after calling setDataSource

$
0
0
Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-03-31/PowerEdition Deployment 2014-03-31)

I'm moving some code from 4.0 to 4.1 and I found an issue where the code is getting null pointer exceptions. These are happening because of calls to either ListGrid.getField or ListGrid.setFieldTitle immediately after calling setDataSource.

Here is an example of some code:
Code:

  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);

This worked in 4.0, but now gets a null returned from getField. With 4.1, does the datasource field creation happen later than it did before? At what point are the fields created so that I know it is safe to retrieve them?

Problem with checkboxes focus in 10.0d

$
0
0
There are some problems with checkboxes and the focus in 10.0d (all browsers). Most of the problems were not present in 8.3d

Here it is a video showing how in 8.3d it worked ok and how it fails in 10.0d: http://screencast.com/t/TxLXssfa

You need to unrar the following file inside "isomorphic\system\reference":

https://mega.co.nz/#!0BgjRTjZ!N-17pIJjL9eVd6F1fDZciINKhxAqCNn7aSQj6iSbjmQ

You can see that the previous things that in 8.3d worked now it doesn't:
* The over effect in the checkbox icon
* The focus effect in the checkbox icon while moving by pressing tab key
* The focus effect in the checkbox icon while doing mouse click works ok, but then the blur effect doesn't remove the focused icon
* Under some random circumstances, the whole checkbox component doesn't take the focus. Although the video is recorded using Chrome, this effect is more noticeable in Firefox: if you just load the html and click in any checkbox, the focus doesn't go to there. It goes just when it has it already going there by pressing tab key.

Thanks and regards.

Question about variables in server.properties

$
0
0
I have the following section in my server.properties for Real-Time Messaging

Code:

# -------------- 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

Where "fooBarConnectionFactory" is defined in Tomcat:

Code:

<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"
/>

Is it possible to replace the string "fooBarConnectionFactory" in server.properties with a Spring variable defined elsewhere in my project? For example something like ${my-connection-factory} which maps to fooBarConnectionFactory.

(My instinct tells me the answer is no, because I know that server.properties is a proprietary SmartGWT properties file and it has no way of knowing about any properties I've defined elsewhere in my project.)

width of an autofit button

$
0
0
I'm using SmartGWT 4.1-p20140316.

I need to determine the width of a an autofit button. When I call the getWidth method it always returns 1.

If I explicitly set the width of the button then it returns whatever I set it to.

How can I get the width of an autofit button?

ComoboxItem and missing value fetching

$
0
0
Hello,

when a ComboboxItem have an OptionDataSource, SmartGWT will fetch the record from the OptionDataSource, when a value is set for the ComboboxItem.

When the record is fetched, I can access the record via getSelectedRecord. Before the record is fetched getSelectedRecord returns null.

Is there a handler which is called, when the record is fetched and is accessable via getSelectedRecord?

Is there another way to add some functionality when the record is available.

In my case, I want to set the hint for the ComboboxItem with additional data from the record.

Regards

Peter

editNewRecord in smartGwt 4.1

$
0
0
Hi,

We are using ValuesManager.editNewRecord(Record) in our application using 4.0.
In 4.1 this method no longer exists, so we need to change this to editNewRecord(Map)

This is fine. However, is there a list of all API changes between 4.0 and 4.1 available somewhere?

Regards
Rolf Woll

4.1 Power SQL datasource and nativeName

$
0
0
Hi,

We are trying to upgrade to 4.1 Power edition build 03.30.2014.
After upgrade we get an SQL error when fetching data from some of our datasources.

We are using SQL server, and have datasources that join multiple tables using tableClause and groupClause. Since some of the joined in tables have fields with the same name, we use tableName and nativeName in the field declarations to identify the various fields:

Code:

                <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" />

field deleted_url points to the deleted_reference.url and field approval_url points to table archive_reference.url.

In 4.0 SmartGwt generates a query like this:

SELECT COUNT(*) FROM (SELECT archive_reference.url AS approval_url, deleted_reference.url AS deleted_url, [various other fields removed] FROM ...

This query works fine.

However for 4.1 the query is:

SELECT COUNT(*) FROM (SELECT distinct archive_reference.url, deleted_reference.url,[various other fields removed] FROM ...

which gives the following SQL error:
The column 'url' was specified multiple times for 'work'

Any ideas?
Regards
Rolf

Separator in SelectItem

$
0
0
Hi,
We are using SmartGwt-4.0 pro edition.
We have a requirement separating two groups in SelctItem.
Example :
SelectItem selectOtherItem = new SelectItem("filter", "Filter");
LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
Group-1
---------------------------------
filterMap.put("filter0", "Filter 0");
filterMap.put("filter1", "Filter 1");
filterMap.put("filter2", "Filter 2");
Group-2
-----------------------------------
filterMap.put("create", "Create New");
filterMap.put("edit", "Edit");
selectOtherItem.setValueMap(filterMap);

In SelctItem Filter 1 , Filter 2, Filter 3,... Filter-n are dynamically adding while creating new("Create New").
As we mentioned above, we want to separate Group-1 and Group-2 with a DOTTED LINE.
This DOTTED LNE can not be selectable and it should be just a separator.
We checked with SmartGwt API, but we didn't found.
Is there any property to achieve this ?
Please give us a solution.
Please find the attached screenshot.

Thanking you.

Attached Images
File Type: png Sepeartor_In_SelectItem.png (2.6 KB)

FloatItem getValueAsFloat() exception

$
0
0
Isomorphic SmartClient/SmartGWT Framework (v9.0p_2014-02-28/EVAL Deployment 2014-02-28)

Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException
Exception caught: invoke arguments: JS value of type string, expected float
See the Development console log for details.
Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.

FormItem.class
Code:

    /**
    * 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);
    }-*/;

Exported PDF orientation

$
0
0
Hello,

I use :

SmartClient Version: v9.1p_2014-03-31/PowerEdition Deployment (built 2014-03-31)

IE 8

I try to export a ListGrid content in pdf format this way (js client code) :

isc.RPCManager.exportContent(grid);

My problem is that this pdf export is made with portrait orientation and my ListGrid is truncated.

How can I set page orientation of exported pdf ?

Thanks in advance

9.1 Regression: valueMap not working for grid

$
0
0
v9.1p_2014-03-28
This problem does not exist in v9.0p_2013_08_05

With the release of 9.1, the data being returned from the server is no longer being flattened as it was in 9.0. This is causing issues in our production environment as our grid is now missing important data.

This test case requires a server side data source and configuration, all of which are included in this post. I have significantly slimmed this test case down to illustrate the problem.

Reproduction steps:
- load test case in 9.1 (03/28)
- observe that the grid project title is blank
- open up a browser console, note that the data is not flattened for projectTitle:
Code:

//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
- load test case in 9.0 (08/05)
- observe that the grid project title field is populated
- open up a browser console, note that the data is flattened for projectTitle:
Code:

//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
While not in this test case, we build out the datasource config dynamically becuase the data is specific to the user. The only constant is the child object project. This test case illustrates a config where the data has inspections, observation and a project. However, another user may have unsafe count, last inspection date and project. The way that we implemented this was as a map, since the number of combinations for this data is too large to create separate java beans for each user.


Datasource Config
==============
Code:

<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>

Datasource Class
==============
Code:

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;

  }
}

Project Class (used in response)
==============
Code:

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;
    }
}

Test Case
==============
Code:

<!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>

DateUtil setWeekendDays

$
0
0
How can I change the weekend days just for a particular instance of a Calendar?

I see there is a DateUtil.setWeekendDays method, but will that change it for the entire client?

In my application, you can create different "calendar" objects (where "calendar" is our own server object that defines aspects of a calendar like working days). The user can then render different "calendars" which may have different working days/weekend days so I need to be able to create a client Calendar and change the weekend days on just that calendar.

Thanks.

Using FilterBuilder to specify specific detail fields

$
0
0
Hi,

Using the FilterBuilder, is there a way to search for Master Fields by specifying specific detail fields?
I.e. given the following DSs
Code:

            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);

and
Code:

  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);

and Code
Code:

@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(); 
    }

is it possible to formulate a query like “Detail field contains detail1 and detail2 and not detail3” to return corresponding Master fields?
Using the standard filter Editor (above the grid), it is possible to formulate “or” queries like “Detail field contains detail1 or detail2 or detail3” which work without problems. Since I need more complex queries, I tried the FilterBuilder but it did not generate proper Critieria even when simulating the filter Editor.

I.e. When selecting some values in its SelectItem, the filter Editor generates

Code:

  criteria:[
            {
                fieldName:"e",
                operator:"inSet",
                value:[
                    3,
                    2
                ]
            }
        ]

whereas the FilterBuilder (using “is one of”) generates criterias like
Code:

  criteria:[
            {
                operator:"inSet",
                fieldName:"e",
                value:[
                    null,
                    null
                ]
            }
        ]

In addition, I cannot properly set the detail fields in the FilterBuilder (i.e. values are forgotten and in the field it just shows detail7, detail7 when in fact detail6, detail5 was selected; see screeshot). This all looks like a bug to me. An Eclipse project showing the issue is here (https://dl.dropboxusercontent.com/u/18305668/MasterDetailFilter.zip) for reference (LGPL libs need to be put in libs and the project needs to be compiled).

Thanks & cheers,
fatzopilot

SGWT: SmartClient Version: v9.1d_2014-02-26/LGPL Development Only (built 2014-02-26)

Attached Images
File Type: png Img.png (10.3 KB)
Viewing all 4756 articles
Browse latest View live