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

Printing Calendar or Timeline with Dayview

$
0
0
Hi,
I observed a bug while triying to printpreview a Calendar or Timeline when it is in Dayview or Weekview. The only one which work is the Monthview. I tested this behaviour with IE and FireFox on the online version (http://www.smartclient.com/smartgwt/showcase/#workday_calendar_category) and (http://www.smartclient.com/smartgwt/showcase/#simple_timeline).

The log message in Internet Explorer is:

14:46:34.402:MUP5:WARN:Log:Error:
'Cet objet ne gère pas cette propriété ou cette méthode'
in http://www.smartclient.com/smartgwt/showcase/isc_ts-2014-03-25/showcase/sc/modules/ISC_Calendar.js
at line 14
Canvas.getChildPrintHTML(_1=>[WeekSchedule ID:isc_Calendar_0_weekView], _2=>Obj, _3=>anonymous())
"return _1.getPrintHTML(_2,_3)"
continuePrintHTMLFun(printInnerHTML=>"")
Canvas.getPrintHTML(printProperties=>Obj, callback=>anonymous())
** recursed on Canvas.getChildPrintHTML

SMARTGWT in only a portion of a Page

$
0
0
Hello,

Is it possible to only show the app in one "div" portion of a page?

For example:

<body>
<div id="header stuff">...</div>
<div id="smartgwt section only goes here"></div>
<div id="footer stuff">...</div>
</body>

Everything I've needed to do up to this point has been full screen but now I have a requirement to use smartgwt inside a page, controlled by a dreamweaver template.

Facet chart line colors

$
0
0
Hi,
I'm using SmartGWT pro 4.0p-20140318.
I've a use case in which I need to assign color to time series lines based on the retrieved data for e.g. if some data is not present color is RED otherwise GREEN. I tried setting setDataColors() but it gives me IllegalStateException - this property cannot be changed after the component has been created.

Is there any way I can set the data colors after the chart is created? If not, is there any other option?

Thanks.

listGrid hilite and multisort dialogs

$
0
0
I'm using version v9.1p_2014-03-25/Enterprise Development Only (2014-03-25) of SmartClient with Chrome 33.0.1750.154 beta-m.

A listGrid's multiSort and hilite dialogs open in the middle of the browser page. Is there any way to control where these dialogs open? Or would it be possible to expose these dialogs as autoChildren of the listGrid? This would be one way for us to to then specify opening co-ordinates for these 2 dialogs.

header wrap behaves differently in 9.1

$
0
0
I tested with SmartClient_v83p_2013-08-18 and with SmartClient_v91p_2014-03-23_PowerEdition.

In 8.3, the following example wraps the header titles. In 9.1, t only wraps one of the header titles.

Code:



var testDs = [{
cwDynamic0:"1",
cwDynamic1:"2"


}];

isc.ListGrid.create({
                        ID: "testWrap",autoDraw:true,
                        confirmDiscardEdits: false,
                        modalEditing: true,width:700,
                        data: testDs,
                        autoSaveEdits: true,
                        showPrompt: false,
                        validateByCell:true,
                        headerHeight: 25,
                        headerButtonProperties: {wrap: true},
                        selectionProperty: "$isCwSelected",
                        $cwIsDynTable: true,
                        fields: [{name:"cwPK__",primaryKey:"true",showIf:" return false"},
                        {name:"cwDynamic0",title:"Generic Product Indicator",type:"text"},
                        {name:"cwDynamic1",title:"Equipment Feature SED Type",type:"text"},
                        {name:"cwDynamic2",title:"Call Forwarding Don't Answer",type:"boolean"},
                        {name:"cwDynamic3",title:"OS Long Product Description",type:"text"},
                        {name:"cwDynamic4",title:"Value (Custom Range Privileges)",type:"text"}],
                        height: "100%"
                       
                });

Class extension

$
0
0
Hi Isomorphic,

As you guys know, I am working on adding Typescript definitions for SmartClient. I am having a hard time understanding inheritance though.

I have to admit that I am a Java developper, Javascript is familiar but not in the intricacies of protypes etc.

Obviously, the way you do inheritance is to define a new class and add properties to it, then calling the create method.

If I want to subclass it in a more natural way, I need a way to connect my subclass (in the Typescript sense) to the superclass (defined with isc.DefineClass...). So right now I'm pretty lost. I guess there could be ways to connect prototypes together somehow, but I would need more help from you to have a plan on the proper method.

Typescript extension:
Code:

class A{
}

class B extends A {
    constructor() {
        super();
    }
}

generates the following javascript

Code:

var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
var A = (function () {
    function A() {
    }
    return A;
})();

var B = (function (_super) {
    __extends(B, _super);
    function B() {
        _super.call(this);
    }
    return B;
})(A);

How could I make a subclass have its own set of functions while still retaining the super class properties?

With the stuff I am working on, the superclass will be more easily understood, but the subclass still needs to be connected for everything to work.

Thanks for your suggestions

Issue with UI XML in SmartGWT EE 4.1

$
0
0
I have an application that uses the ScreenLoaderServlet to serve up some of the layouts from *.ui.xml files on the server. When moving the application from SmartGWT EE 4.0 to SmartGWT EE 4.1, I get an exception trying to access HLayout and VLayout children of a given screen using Canvas.getByLocalId(). Here is the code snippet where the exception is thrown:

Code:

RPCManager.cacheScreens(displayList.toArray(new String[{"Master"}), new Function() {

@Override
public void execute() {
        Canvas masterPane = RPCManager.createScreen("Master");
 
        // Interesting that this line here for the TabSet does
        // NOT throw an error
        TabSet tabs = (TabSet) masterPane.getByLocalId("MainTab");                               
        tabs.getTabBar().setAlign(Alignment.CENTER);

        // This object is actually in HLayout in the markup,
        // and it throws an assertError as described below. 
        Canvas ctr = masterPane.getByLocalId("HomeContainer");
}
};

With a little debugging, the error appears to be that even though "HomeContainer" is really an HLayout, it's Java object reference gets set to a plain Canvas somewhere before HLayout.getOrCreateRef is called. I was unable to figure it out beyond that. Here's the complete stack trace:


java.lang.AssertionError: null
at com.smartgwt.client.widgets.layout.HLayout.getOrCr eateRef(HLayout.java:107)
at com.smartgwt.client.widgets.layout.HLayout.getOrCr eateRef(HLayout.java:1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessagesWhileWaitingForReturn(BrowserChannelSer ver.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeO bject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veObject(JavaScriptHost.java:91)
at com.smartgwt.client.util.ObjectFactory.createCanva s(ObjectFactory.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessagesWhileWaitingForReturn(BrowserChannelSer ver.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeO bject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.Canvas.getByJSObject(C anvas.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessagesWhileWaitingForReturn(BrowserChannelSer ver.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeO bject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.Canvas.getByLocalId(Ca nvas.java)
at com.eterra.tdm.ui.client.view.smartgwt.SgwtMasterT dmView$1.execute(SgwtMasterTdmView.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessagesWhileWaitingForReturn(BrowserChannelSer ver.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeO bject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.ja va)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.j ava:347)
at sun.reflect.GeneratedMethodAccessor43.invoke(Unkno wn Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.proc essConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run( BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:744)

Here's the RPC return from cacheScreens:
[
{
screenName:"Master",
source:"\n\t\n\tisc.HLayout.create({\n ID:\"HomeContainer\",\n autoDraw:false\n})\n\n\tisc.VLayout.create({\n ID:\"ComponentsContainer\",\n autoDraw:false\n})\n\n\tisc.VLayout.create({\n ID:\"BuildsContainer\",\n autoDraw:false\n})\n\n\tisc.VLayout.create({\n ID:\"ReleasesContainer\",\n autoDraw:false\n})\n\n\tisc.VLayout.create({\n ID:\"DeploymentsContainer\",\n autoDraw:false\n})\n\n\tisc.Label.create({\n Align:\"LEFT\",\n ID:\"separatorBar\",\n contents:\"|\",\n height:40,\n styleName:\"indentedHiliteTitle\",\n width:10\n})\n\n\tisc.Img.create({\n Align:\"LEFT\",\n ID:\"testImg\",\n imageType:\"CENTER\",\n size:40,\n src:\"icn_action_req.svg\"\n})\n\n\tisc.Label.crea te({\n Align:\"RIGHT\",\n ID:\"jobname\",\n VAlign:\"BOTTOM\",\n contents:\": Jobname1234\",\n height:40\n})\n\n\tisc.LayoutSpacer.create({\n ID:\"spacer1\",\n width:\"50%\"\n})\n\n\t\t\n\tisc.HLayout.create({\ n ID:\"titleBar\",\n height:10,\n styleName:\"topBarStyle\",\n width:\"100%\",\n members:[\n spacer1,\n testImg,\n jobname\n ]\n})\n\t\n\t\t\n\tisc.TabSet.create({\n ID:\"MainTab\",\n autoDraw:false,\n height:\"*\",\n width:\"100%\",\n tabs:[\n {\n canClose:false,\n title:\"__Home\",\n pane:HomeContainer,\n ID:\"TabHome\"\n },\n {\n canClose:false,\n title:\"__Components\",\n pane:ComponentsContainer,\n ID:\"TabComponents\"\n },\n {\n canClose:false,\n title:\"__Builds\",\n pane:BuildsContainer,\n ID:\"TabBuilds\"\n },\n {\n canClose:false,\n title:\"__Releases\",\n pane:ReleasesContainer,\n ID:\"TabReleases\"\n },\n {\n canClose:false,\n title:\"__Deployments\",\n pane:DeploymentsContainer,\n ID:\"TabDeployments\"\n }\n ],\n canCloseTabs:false,\n destroyPanes:false,\n symmetricEdges:true,\n showResizeBar:false,\n showShadow:false\n})\n\n\t\n\tisc.VLayout.create({ \n ID:\"MainContainer\",\n height:\"100%\",\n width:\"100%\",\n members:[\n titleBar,\n MainTab\n ]\n})\n\n\t\n\n"
}
]

Version info from developer console:
SmartClient Version: v9.1p_2014-03-25/Enterprise Deployment (built 2014-03-25)

SmartGWT 4.1 DataSourceField.getType() throws exception for "number"

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

Moving from SmartGWT 4.0. to 4.1, I've come across an exception being thrown when calling getType() on a datasource field.

The field in the ds.xml looks like this:
Code:

<field primaryKey="true" name="my_id" type="number" hidden="true"></field>
The code on the client looks like this:
Code:

final DataSourceField[] dataSourceFields = dataSource.getFields();
for ( final DataSourceField currentField : dataSourceFields ) {
 FieldType type = currentField.getType();
 
 ... snip other code ...
}

It looks like pre-4.1, this call would return null for a "number" fieldtype. Now it is throwing an exception.

The call to currentField.getType() throws the following exception:
Code:

com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.core.BaseClass::getAttributeAsString(Ljava/lang/String;)([string: 'inheritsFrom']): widget.getPropertyValue is not a function
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:487)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
        at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:724)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.core.BaseClass::getAttributeAsString(Ljava/lang/String;)([string: 'inheritsFrom']): widget.getPropertyValue is not a function
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.core.BaseClass.getAttributeAsString(BaseClass.java)
        at com.smartgwt.client.data.SimpleType.getInheritsFrom(SimpleType.java:283)
        at com.smartgwt.client.data.DataSourceField.getType(DataSourceField.java:2698)

This snippet from the trace log shows that 'number' is in the list of SimpleTypes from the builtinTypes.xml
Code:

DEBUG,03/26/2014 14:46:41:732,com.isomorphic.xml.XML,Parsed XML from __USE_CONTAINER__/app/sc/system/schema/builtinTypes.xml: 7ms,

INFO,03/26/2014 14:46:41:774,com.isomorphic.pool.PoolManager,SmartClient pooling started for 'simpleTypes' objects,

DEBUG,03/26/2014 14:46:41:774,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'simpleTypes',

DEBUG,03/26/2014 14:46:41:814,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'Object',

DEBUG,03/26/2014 14:46:41:825,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'any',

DEBUG,03/26/2014 14:46:41:830,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'boolean',

DEBUG,03/26/2014 14:46:41:831,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'integer',

DEBUG,03/26/2014 14:46:41:832,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'float',

DEBUG,03/26/2014 14:46:41:833,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'date',

DEBUG,03/26/2014 14:46:41:834,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'time',

DEBUG,03/26/2014 14:46:41:835,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'text',

DEBUG,03/26/2014 14:46:41:836,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'string',

DEBUG,03/26/2014 14:46:41:837,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'link',

DEBUG,03/26/2014 14:46:41:838,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'int',

DEBUG,03/26/2014 14:46:41:839,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'long',

DEBUG,03/26/2014 14:46:41:840,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'number',

DEBUG,03/26/2014 14:46:41:842,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'decimal',

DEBUG,03/26/2014 14:46:41:844,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'double',

DEBUG,03/26/2014 14:46:41:845,com.isomorphic.pool.ISCKeyedObjectPool,Borrowing object for 'dateTime',

Should the FieldType returned be FieldType.INTEGER since "number" inherits from "integer"?

selectString is not a function error in RestDataSource transformResponse

$
0
0
Hi Isomorphic,

I'm following the documentation for configuring RestDataSource using Spring controllers. I'm getting the error in the title when performing a fetch operation.

The JSON Response is as follows (shown in Dev console), which pretty much is the same format as in the RestDataSource javadoc:

Code:

{"response":{"status":0,"startRow":0,"endRow":1,"totalRows":1,"data":[{"apellido":"last_name","nombre":"name","username":"uname","email":"carlep@live.com.ar","password":""}]}}
The DataSource definition:

Code:

package com.sgrvg.client.main.ds;

import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.OperationBinding;
import com.smartgwt.client.data.RestDataSource;
import com.smartgwt.client.data.fields.DataSourcePasswordField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.DSOperationType;
import com.smartgwt.client.types.DSProtocol;

/**
 * @author pabloc
 *
 * DataSource para administracion de usuarios (modificar datos / password)
 *
 */
public class UserDS extends RestDataSource {
       
        private static UserDS instance = null;
       
        public static UserDS getInstance() {
                if (instance == null) {
                        instance = new UserDS();
                }
                return instance;
        }
       
        private UserDS() {
                super();
               
                setClientOnly(Boolean.FALSE);
               
//                FIELDS
                DataSourceTextField username = new DataSourceTextField("username", "Usuario", 50, true);
                DataSourceTextField nombre = new DataSourceTextField("nombre", "Nombre", 45, true);
                DataSourceTextField apellido = new DataSourceTextField("apellido", "Apellido", 45, true);
                DataSourceTextField email = new DataSourceTextField("email", "E-Mail", 255, false);
//                En cambio de password poner como hidden y luego de la validacion modificarle el valor y hacer el saveData
                DataSourcePasswordField currentPassword = new DataSourcePasswordField("password", "Password", 50, true);

                setFields(username, nombre, apellido, email, currentPassword);
               
//                DSRequest properties
                DSRequest updateRequest = new DSRequest(DSOperationType.UPDATE);
                updateRequest.setHttpMethod("PUT");
                updateRequest.setContentType("application/json");
               
//                OPERATION BINDINGS
                OperationBinding fetch = new OperationBinding(DSOperationType.FETCH, "service/user");
                fetch.setDataProtocol(DSProtocol.GETPARAMS);
                fetch.setDataFormat(DSDataFormat.JSON);
                               
                OperationBinding update = new OperationBinding(DSOperationType.UPDATE, "service/user");
                update.setDataProtocol(DSProtocol.POSTMESSAGE);
                update.setDataFormat(DSDataFormat.JSON);
                update.setRequestProperties(updateRequest);
               
                setOperationBindings(fetch, update);
               
        }
}

The controller:
Code:

        @RequestMapping(value="/user", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE )
        @ResponseBody
        public DSResponse getUserData(final HttpServletRequest request, Principal principal) {
                final String currentUser = principal.getName();
               
                Usuario usr = usrManager.encontrarUsuarioPorUsername(currentUser);
               
                return new DSResponse(usr);
        }

The issue happens in the transformResponse method

In compiled mode, the error happens in ISC_DataBinding.js (line 2721 if it helps)


Any help would be greatly appreciated.

Browsers: Any
GWT Version: 2.5.1
SmartGWT version: SmartClient Version: v9.1p_2014-03-25/LGPL Development Only (built 2014-03-25)

9.1 Regression: Unable to get property 'fieldName' of undefined or null reference

$
0
0
SmartClient_v91p_2014-03-20_PowerEdition
Works as expected in SmartClient_v90p_2013-08-05

Issue occurs in all browsers, but I have used specific case for IE 10.

Repro steps:
- Load test case
- Click Format button at the top left corner above Grid
- Double Click on any Available fields in hilite editor
- Click Save in hilite editor
- Click Format button again
- The following script error is displayed in Console from IE developer tools:
SCRIPT5007: Unable to get property 'fieldName' of undefined or null reference

Code:

<!DOCTYPE html>

<html>
<head>
<style tyle="text/css">
<!--
@page {
  size: landscape;
 
}
-->
</style>

    <title >SNQA-419</title>
       
          <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
               
                var data = [
                        {inspectorID:12345, region:"United States", state:"Pennsylvania", city:"Pittsburgh", inspections:206,observations:913,lastInspectionDate:new Date(2012, 8, 13),index:52.6, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:67890, region:"United States", state:"Pennsylvania", city:"Butler", inspections:66,observations:0,lastInspectionDate:new Date(2013, 2,2),index:75.3, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:88776, region:"United States", state:"Pennsylvania", city:"Pittsburgh", inspections:66,observations:67,lastInspectionDate:new Date(2013,2,3),index:75.3, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:44556, region:"United States", state:"Pennsylvania", city:"Philadelphia", inspections:206,observations:0,lastInspectionDate:new Date(2012,8,31),index:52.6, inspectionType: {id:123, name:"type1"}}
                ];
</script>
       
 <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>
       
</head>
<body>

        <br><br>
        <script>
       
                        isc.DataSource.create({
                                ID: "ds",
                                fields: [
                                        {name:"inspectorID", title:"Inspector ID", type:"integer" },
                                        {name:"inspections", type:"integer", title:"Number of Inspections"},
                                        {name:"static", type:"text", title:"Really Long Static Field Title loooooooooooooooooong"},
                                        {name:"region", type:"text", title:"Region/Country"},
                                        {name:"state", type:"text", title:"State"},
                                        {name:"city", type:"text", title:"City/Municipality"},
                                        {name:"observations", title:"# Observations"},
                                        {name:"lastInspectionDate", type:"date", title:"Last Inspection"}
                                ],
                                cacheData:data,
                                clientOnly: true
                        });
                       
                        var gridObject = isc.ListGrid.create({
                                dataSource: ds,
                                dataFetchMode : "local",
                                autoFetchData: true,
                                clientOnly: true,
                                width : "100%",
                                align : "center",
                                autoFitData : "vertical",
                                autoFitMaxHeight : 400,
                                alternateRecordStyles : true,
                                canAddFormulaFields : true,
                                canAddSummaryFields : true,
                                canGroupBy : true,
                                canReorderFields : true,
                                showGroupSummary : true,
                                groupByMaxRecords : 5,
                                useAdvancedFieldPicker: true,
                                autoDraw: false,
                                advancedFieldPickerThreshold: 5
                        });       
                       
                       
                        isc.VLayout.create({
                                                        width:"100%",
                                                        members : [ isc.Button.create({
                                                                name : "formatGridButton",
                                                                title : "Format",
                                                                type : "button",
                                                                align: "center",
                                                                //autoFit : true,
                                                                click : function() {
                                                                        gridObject.editHilites()
                                                                }
                                                        }), gridObject
                                                        ]
                                                       
                                                });
                       
                       
        </script>
        <br><br>

</body>

</html>

9.1 Regression:UI issue for field with long title on Format dialog

$
0
0
SmartClient_v91p_2014-03-20_PowerEdition
Works as expected in SmartClient_v90p_2013-08-05

Repro steps:
- Load test case
- Double Click "Really Long Static ....." from available fields in hilite editor

Observed:
IE8: Text is overlapped with drop-down list
IE10: There is no space between fields and some times UI elements are pushed to right

Expected:
Behavior similar to before in 9.0 P where longer text is shown with ... at the end and when you hoover full text is shown. This behavior would help to avoid issues with varying grid size and screen resolutions.

Code:

<!DOCTYPE html>

<html>
<head>
<style tyle="text/css">
<!--
@page {
  size: landscape;
 
}
-->
</style>

    <title >SNQA-421</title>
       
          <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
               
                var data = [
                        {inspectorID:12345, region:"United States", state:"Pennsylvania", city:"Pittsburgh", inspections:206,observations:913,lastInspectionDate:new Date(2012, 8, 13),index:52.6, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:67890, region:"United States", state:"Pennsylvania", city:"Butler", inspections:66,observations:0,lastInspectionDate:new Date(2013, 2,2),index:75.3, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:88776, region:"United States", state:"Pennsylvania", city:"Pittsburgh", inspections:66,observations:67,lastInspectionDate:new Date(2013,2,3),index:75.3, inspectionType: {id:123, name:"type1"}},
                        {inspectorID:44556, region:"United States", state:"Pennsylvania", city:"Philadelphia", inspections:206,observations:0,lastInspectionDate:new Date(2012,8,31),index:52.6, inspectionType: {id:123, name:"type1"}}
                ];
</script>
       
 <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>
       
</head>
<body>

        <br><br>
        <script>
       
                        isc.DataSource.create({
                                ID: "ds",
                                fields: [
                                        {name:"inspectorID", title:"Inspector ID", type:"integer" },
                                        {name:"inspections", type:"integer", title:"Number of Inspections"},
                                        {name:"static", type:"text", title:"Really Long Static Field Title loooooooooooooooooong"},
                                        {name:"region", type:"text", title:"Region/Country"},
                                        {name:"state", type:"text", title:"State"},
                                        {name:"city", type:"text", title:"City/Municipality"},
                                        {name:"observations", title:"# Observations"},
                                        {name:"lastInspectionDate", type:"date", title:"Last Inspection"}
                                ],
                                cacheData:data,
                                clientOnly: true
                        });
                       
                        var gridObject = isc.ListGrid.create({
                                dataSource: ds,
                                dataFetchMode : "local",
                                autoFetchData: true,
                                clientOnly: true,
                                width : "100%",
                                align : "center",
                                autoFitData : "vertical",
                                autoFitMaxHeight : 400,
                                alternateRecordStyles : true,
                                canAddFormulaFields : true,
                                canAddSummaryFields : true,
                                canGroupBy : true,
                                canReorderFields : true,
                                showGroupSummary : true,
                                groupByMaxRecords : 5,
                                useAdvancedFieldPicker: true,
                                advancedFieldPickerThreshold: 5
                        });       
                       
                        gridObject.editHilites();
                       
        </script>
        <br><br>

</body>

</html>

Change of behavior in ValuesManager saving a ListGridRecord

$
0
0
A change of behavior between two versions of SmartGWT in how ValuesManager saves a ListGridRecord is preventing my application from being able to save any data with ListGridRecords when using the later version.

Scenario:
A Window has a ListGrid that uses a ValuesManager bound to a DataSource we'll call Foo that has 3 fields: bar (String), baz (String) and bork (Integer).

The ListGrid has one record in it with the following attributes:
bar=abcde
baz=fghij
bork=4

When calling valuesManager.saveData(), the ValuesManager has a different Map of data depending on the version of SmartGWT. The code blocks below show the result of a valuesManager.getValues() call.

Previous behavior in SmartClient Version: v8.3_2012-11-20:
Code:

{foo={__ref=com.smartgwt.client.widgets.grid.ListGridRecord@1aaa57b, bar=abcde, baz=fghij, bork=4}}
Behavior with SmartClient Version: v9.0p_2014-02-13
Code:

{foo=com.smartgwt.client.widgets.grid.ListGridRecord@2}
Our app cannot process the "ListGridRecord@2" object, and I do not know how to get the values out of that object. Our app uses custom datasources and does a lot of custom JSON processing. (I'd rather wait for a first reply before going into the details of that, since I want to first understand the reason for the change in the two versions.)

The only variable between the two examples I presented is the version of SmartGWT. I tried a nightly build of 9.0p from 2014-03-02 and I observe the same behavior.

Destroy the Form in the pop up window after setSaveOnEnter(true);

$
0
0
I have a add button in my ToolsStrip. When clicked on add button there pop s up a dynamic form window, after fetching the data and enter is clicked the data in my form gets saved (data is seen in the background grid). But the Dynamic Form in the pop up window does not gets destroyed.

Is there any handler/any way to destroy the window once data is being saved by clicking enter ?

Thanks in advance.

ListGrid horizontal DrawAheadRatio?

$
0
0
Hello,

There is ListGrid.setDrawAheadRatio() that works for vertical draw ahead ratio. Is there similar method that will affect horizontal draw ahead ratio?
I use a ListGrid with 200 columns, so it would be nice to draw only those which are visible.

SmartGWT v8.3p_2013-02-08/LGPL Development Only (built 2013-02-08)

Regards,
Adam

Chart legend on right

$
0
0
Hi,

Since few days I am using SmartGWT 3.1 evaluation version downloaded from http://www.smartclient.com/product/downloadOtherReleases.jsp

I am evaluating charts.

My questions are,

1. Right now legends shows at the bottom of the chart, can I move it to the right / left side, so that my chart get some extra vertical space ?
2. I want to show the value when I mouse over some section on chart, and want to hide it when I am not on that section. It is not happening right now, the value keeps showing if i am there on different chart are like legend or axis.

Can you please answer my questions asap ?

I want to buy the SmartGWT PRO version but before that I want solutions about some charting questions.

Bug: DataSource cacheAcrossOperationIds attribute

$
0
0
Hi,

I wanted to switch the cacheAcrossOperationIds datasource attribute to false (and use the client-side caching facilities for 1 operation ID only). I've read the documentation and have set up the other attributes to the correct values.

I wanted to report that if I turn off this attribute by setting it to "false" in the .ds.xml, it does not work.

I checked the value in the client by calling getCacheAcrossOperationIds() on the datasource and got the following exception:

Code:

com.google.gwt.dev.shell.HostedModeException: invoke arguments: JS value of type string, expected boolean
        at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:100)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:65)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.core.BaseClass.getAttributeAsBoolean(BaseClass.java)
        at com.smartgwt.client.data.DataSource.getCacheAcrossOperationIds(DataSource.java:285)

On the other side, if "hardcode" this attribute in the client as well by calling:

Code:

ds.setAttribute("cacheAcrossOperationIds", false, true);
Then, getCacheAcrossOperationIds() does work and the whole cache mechanism works as I want.

Is it possible to fix this so that we can fine tune the caching features in the xml instead of in the code ?

Many thanks,

Thomas

How to assign a data to the tree grid after the creation.

$
0
0
Hi,

Can you please let me know, how to assign the data to the treegrid after its created, and i dont want to use datasource. I am using RPC command to get the data.

Thanks

smartgwt 4.0 and 4.1 IE8 support

$
0
0
Is IE 8 (win xp) supported in smartgwt 4.0 and 4.1? After update from 3.x it doesn't load in IE8 (standard and compatible mode, with cleared cache). I also tried the smartgwt showcase from your websites. There is the same problem, the showcase shows only the loading dialog.

Thanks Pavel

ListGrid Field validators and validateOnChange

$
0
0
Hi,

Using SmartClient_v90p_2014-01-24_Pro (Google Chrome), I'm having an issue with ListGrid fields onto which I
attach a validator and for which the listGrid is configured with validateOnChange.

The problem is that the validation doesn't **ALWAYS** fire onChange. Sometimes it does,
sometimes it only fires when I leave the field.

Here are the steps to reproduce a 1st way this problem manifests itself:

1) Click on one of the row's POPULATION column and enter value 12345 ... not pressing tab/enter (should trigger validation message, but doens't) <-- PROBLEM HERE
2) When you try tabbing outside the field, the validator kicks in

Here are the steps to reproduce a 2nd way this problem manifests itself:

1) Click on one of the row's POPULATION column and enter value 123 ... not pressing tab/enter (which is valid since validator max is set to 999)
2) Press the tab key to move to the X column and enter value 123 ... not pressing tab/enter (also valid)
3) Press shift-tab to move back to the POPULATION column
4) Enter the value 12345 (should trigger validation message, but doens't) <-- PROBLEM HERE
5) When you try tabbing outside the field, the validator kicks in

If you try the following scenario, it works as expected:

1) Click on one of the row's POPULATION column and enter value 123 ... not pressing enter (which is valid since validator max is set to 999)
2) Press the tab key to move to the X column and enter value 12345 (validation gets triggered as expected, before the user even needs to move outside the field)


We'd like it to always behave like in the 3rd scenario. Is there some combination of boolean flags or other switches that are required and that we're not using properly?

Here's a test bed to reproduce the above scenarios (from Featured Samples -> Grids -> Editing -> Edit by cell):

Code:

isc.ListGrid.create({
    ID: "countryList",
    width:550, height:224, alternateRecordStyles:true, cellHeight:22,
    // use server-side dataSource so edits are retained across page transitions
    dataSource: countryDS,
    // display a subset of fields from the datasource
    fields:[
        {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
        {name:"countryName"},
        {name:"continent"},
        {name:"member_g8"},
        {name:"population", type: 'integer', validators : [{ type : 'integerRange', min : 0, max : 999, validateOnChange : true, stopOnError : true }] },
        {name:"x", type: 'integer', validators : [{ type : 'integerRange', min : 0, max : 999, validateOnChange : true, stopOnError : true }] },
        {name:"y", type: 'integer', validators : [{ type : 'integerRange', min : 0, max : 999, validateOnChange : true, stopOnError : true }] },
        {name:"independence"}
    ],
    autoFetchData: true,
    canEdit: true,
    editEvent: "click",
    editByCell: true,
stopOnErrors : true,
validateByCell : false,
validateOnChange : true
})

Thanks,

Mini zoom chart right slider issue

$
0
0
Hi,
I'm using SmartGWTPro version 4.0p-20140318.

I'm using zoom chart and I would like to display the whole data set in the main chart when the chart is initially displayed. After the chart is displayed user can zoom into a particular time range using mini chart at the bottom. My chart also allows the user to change the query which replaces the data set in the same chart object. I'm using setZoomStartValue() and setZoomEndValue() to set the first and the last point to display the whole dataset. This works fine the first time. After the chart is displayed and if user moves the sliders to zoom in and changes the query to display another data set, the left slider moves to the starting point but the right slider stays at the previous location. Due to this whole data set is not displayed. Since I'm calling setZoomEndValue() after the data is retrieved, the right zoom slider should move to the last point all the way to the right and the main chart should display the whole range.

One more thing - If I just call setZoomStartValue() and do not call setZoomEndValue(), as per documentation "If zoomEndValue is not also set, the range shown will be from zoomStartValue to the end of the dataset." This is not working as documented. The range is not set to the end of the dataset.

Am I doing something wrong?

Thanks.
Viewing all 4756 articles
Browse latest View live