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

Problem while resizing ListGrid

$
0
0
I come from here

http://forums.smartclient.com/showthread.php?t=27879&page=3

I have been able to get a 'simple' html file to reproduce the original issue.
As you can see in the following video:
http://screencast.com/t/KpxDHeIbh

You can easily get broken the header/rows alignment.

The html to reproduce the issue is here:
https://mega.co.nz/#!0QwQHLID!MT8sYEUm0qy6eFN3EKh45CkIdhkZmgQ--Y37RmlEqs4

You have to unrar it into:
smartclientSDK\isomorphic\system\reference

PS: It have been tested 10.0d 05-Jan-2014

ToolStripMenuButton icon bug?

$
0
0
It seems that ToolStripMenuButton does not show my icon because it seems that attribute is used to display the submenu icon instead. Here's a test case. I've used the same image in two places to demonstrate that the path to the image is correct.


Code:

isc.Menu.create({
    ID: "docMenu",
    data: [
      {title: "User's Manual",
        // this usage correctly appears; proves the image exists:
        icon: "pieces/16/cubes_green.png"}
    ]
});

isc.ToolStripMenuButton.create({
    ID: "docMenuButton",
    title: "Documentation",
    // this icon is not appearing:
    icon: "pieces/16/cubes_green.png",
    menu: docMenu
});

isc.ToolStrip.create({
    members: [docMenuButton]
});


If I use
Code:

docMenuButton.setIcon("pieces/16/cubes_green.png");
then the submenu icon is replaced with cubes_green.png, which is not behavior I would have expected.

i.e. it doesn't appear to be possible to have both my icon and the submenu icon appear at the same time. The Reference Overview page for ToolStripMenuButton says that it is possible to display an "icon with text". Is this is a software bug or a documentation bug?

I'm using SmartClient 9.0 evaluation version on Safari 6.1.1.

ListGrid auto refresh at some interval using Timer.setTimeout

$
0
0
Version v9.0p_2013-12-19/PowerEdition

I have a listGrid whose ID is: mListGrid

I have falling callback:
Code:

var mCallback = function(dsResponse, data, dsRequest){
    var lResultSet = isc.ResultSet.create({
        dataSource: mListGrid.getDataSource(),
        initialData: dsResponse.data
    });
    mListGrid.setData(lResultSet);

    // set time out
  if(mAutoRefresh == "true")
  {
      isc.Timer.setTimeout("progress()", 5000);
  }
}

Suppose mAutoRefresh is true, and progress function is:
Code:

function progress()
{
    mListGrid.fetchData(mListGrid.getCriteria(), mCallback);
    isc.Timer.setTimeout("progress()", 5000);
}

I'm using the debug tool and find that progress() function is called by every 5 second, but each time, it seems that fetchData() function is not called, because mCallback function is no longer be called.

I also tried to avoid using fetchData(), but using mListGrid.data.invalidateCache(), auto refresh works good, but every time, the grid will flick once, which is not visually good. I still prefer manually call fetchData with callback in the progress() function, because we have some other configuration in the callback function.

Could you please tell what I did is wrong to make mCallback is no longer called. Thanks.

StyleInjector

$
0
0
I'm using Smartgwt 4.0 Dev latest nightly build version.
I'm drawing two canvas component with different dimensions. i'm rounding them using CSS. I receive their dimensions, including the radius from DB and because of using CSS in need to inject the radius there. I've suceeded this but it uses the latest injected value for both canvas objects.
I've used:

StyleInjector.inject(".curved_ {border-radius: "+buttonRadius+"px; behavior: url(PIE.htc);}",true);
canvasCircle.setStyleName(".curved_");

This piece is executed for 2 different objects of type Canvas.
Why is this happening?
Thnak you

Import of exported Excel file.

$
0
0
We are using the SmartGWT Power version.

We have been requested to implement a feature which involves exporting Grid data to excel so that the users can modify cell values in the Excel sheet, then import that excel file back into our web application.

I see there is an excel export capability that exists. Is there a capability for Import that exists that we can use to Import the Excel file previously Exported?

SmartGWT.mobile: Paged Tableview

$
0
0
How do you load the next data page of a paged TableView? I guess, this has to be quite easy... but i just can't figure it out...

Code:

RecordList recordList = new RecordList();
// add 20 records now

TableView tv = new TableView();
tv.setDataFetchMode(FetchMode.PAGED);
tv.setDataPageSize(10);
tv.setData(recordList);

When i add the TableView, the 1st data page (containing records 1 - 10) is shown.
But how can i switch to the 2nd data page (containing records 11 to 20) now?
Thanks a lot in advance!

No results in Reify

$
0
0
Hello.
I'm using SmartClient_SNAPSHOT_v91d_2014-01-13
After importing form with several components including TabSet with Tab's linked content to other mockups I'm just getting empty screen without any errors.

BMML example files are in archive here: http://opt.enzobrera.com/admin/share/smartclient/bmmlfile4test.zip

Root file for import is StkDocIntMove_Edit.bmml

About secureApp

$
0
0
I am evaluating on SmartClient v9.0p_2013-12-19/EVAL Development Only, and trying to understand the secureApp example for further development.

Yet I failed to find out how to grab the current user data for the page layout, which is a very common feature. For example, when I have logged in as john.smith, I want the index.jsp showing a label as something like "Welcome, john.smith".

Which part of the reference document should I read to implement such feature? Thank you very much.

DrawLabel on IE/Firefox/Google Chrom

$
0
0
Hi,
I'm using smartgwt 4.0 Dev nightly build sources.
I'm creating a simple DrawLabel and apply Following properties on it:
- setLineColor(fontColor);
- setFontSize(Integer.parseInt(fontSize));

It shows perfect in IE8 but nothing appears in Firefox or Google Chrome
Thank you

Bug in RadioGroupItem.setDefaultValue(Enum) (with minimal testcase)

$
0
0
Hi Isomorphic,

I'm using RadioGroupItem with a valuemap with an enum as key. This works very well. But if I try to set a defaultvalue, I get an exception with very little details.
I'm using v9.0p_2014-01-13/EVAL Deployment and Development Mode from Eclipse with GWT 2.5.1 (tested with 2.6.1-rc3, too).

Please change the builtInDs example as follows to reproduce:
Code:

package com.smartgwt.sample.client;

import java.util.LinkedHashMap;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.util.KeyCallback;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import com.smartgwt.client.widgets.layout.VStack;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class BuiltInDS implements EntryPoint {
        private DynamicForm boundForm;
        private LinkedHashMap<MyEnum, String> optionMap;

        public void onModuleLoad() {
                KeyIdentifier debugKey = new KeyIdentifier();
                debugKey.setCtrlKey(true);
                debugKey.setKeyName("D");

                Page.registerKey(debugKey, new KeyCallback() {
                        public void execute(String keyName) {
                                SC.showConsole();
                        }
                });

                VStack vStack = new VStack();
                vStack.setLeft(175);
                vStack.setTop(75);
                vStack.setWidth("70%");
                vStack.setMembersMargin(20);

                boundForm = new DynamicForm() {
                        {
                                optionMap = new LinkedHashMap<MyEnum, String>();
                                optionMap.put(MyEnum.O1, "Option 1");
                                optionMap.put(MyEnum.O2, "Option 2");
                                optionMap.put(MyEnum.O3, "Option 3");

                                final RadioGroupItem myRGI = new RadioGroupItem() {
                                        {
                                                setName("Three_options");
                                                setTitle("Three_options");
                                                setColSpan("*");
                                                setRequired(true);
                                                setVertical(false);
                                                setRedrawOnChange(true);
                                                setWidth100();
                                                setValueMap(optionMap);
                                                // This line causes an exception:
                                                setDefaultValue(MyEnum.O1);
                                        }
                                };

                                myRGI.addChangedHandler(new ChangedHandler() {
                                        @Override
                                        public void onChanged(ChangedEvent event) {
                                                MyEnum selectedOption = (MyEnum) myRGI.getValue();
                                                SC.say(selectedOption.getValue());
                                        }
                                });

                                setFields(myRGI);
                        }
                };
                vStack.addMember(boundForm);
                vStack.draw();
        }

        public enum MyEnum {
                O1("One"), O2("Two"), O3("Three");

                private String value;

                MyEnum(String value) {
                        this.value = value;
                }

                public String getValue() {
                        return this.value;
                }
        }
}


Exception:
Code:

11:59:59.389 [ERROR] [builtinds] Unable to load module entry point class com.smartgwt.sample.client.BuiltInDS (see associated exception for details)
com.google.gwt.core.client.JavaScriptException: (null) @com.smartgwt.client.widgets.form.DynamicForm::create()([]): null
    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.widgets.form.DynamicForm.create(DynamicForm.java)
    at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:443)
    at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1267)
    at com.smartgwt.sample.client.BuiltInDS.onModuleLoad(BuiltInDS.java:73)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)

Best regards,
Blama

After editing cell and clicking on next cell does not select

$
0
0
Hello Sir,

When I select the cell from and the click on the next cell from same column it doesn't select clicked cell. It selects the cell from same column but skipping 2 rows.Could you please tell me the cause?

I am using smartgwt 3.0 and browser Chrome Version 31.0.1650.63 m.

Thanks in advance.

Regards,
Dipak

DrawRect.getCenter()

$
0
0
Dear Support,

It seems that the DrawRect.getCenter() method has been removed in the current 4.1d branch. Can you please confirm ? I used to see that one in 4.0p...

Thanks!
Thomas

DrawLabel wrapping

$
0
0
Dear Support,

We are trying to have a rectangle (with a border) in which we display an image and a label. We currently have implemented this using a DrawGroup + 3 children (DrawRect, DrawImage and DrawLabel) and it works.

Our biggest concern is that the label is always drawn in 1 line and it goes outside the rectangle zone of the group.

It's very important for us to have a way to ensure that the label stays inside its frame... How can we do that ? All your examples show the label below the shape, never inside...

-> There's no setWidth() in DrawLabel
-> We cannot use HTML in setContents()
-> setKeepInParentRect() does not help either

Many thanks,
Thomas

FilterBuilder Issue in 9.0 (works in 8.3)

$
0
0
Hello,

I am experiencing a strange issue with the filter builder when using SmartClient 9.0p_2014-01-13_LGPL. The issue is not present with SmartClient 8.3p_2013-02-28_LGPL.

What is happening is that the textboxes for the user to enter filter values are not drawing. So I am ending up with just the field and operator dropdowns, but nowhere to actually enter a filter value.

Again, this is a new behavior since moving from 8.3 to 9.0.

Any help would be greatly appreciated!

Thanks,

Philip

SmartGWT 4.1 General Availability date?

$
0
0
Hi,

When is 4.1 expected to be production ready?
We are trying to upgrade from 3.1 to 4.0, but I am having a problem with a scatter chart.

In 4.0, the X-axis (my time line) appears to be fixed to start at 0. This is an problem since my chart plots data for the past month or so, the data points just appear as one datapoint (all the way to the right). One month is nothing for a chart that starts at 0 Epoche time.

In 3.1, the chart's x-axis was starting at a reasonable time earlier than the earliest data point.

I see a new API http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/widgets/chart/FacetChart.html#setXAxisStartValue(java.lang.Doubl e) in 4.1 that should help. When is 4.1 expected to be GA, or is it possible to back propagate this new API to 4.0?

Thanks,
mdeng

Auto Fit All Columns broken on grouped grid

$
0
0
I have found bug in 'Auto Fit All Columns' on grouped grids. Reproducible on SmartClient 9.0 and 9.1.

Steps to reproduce:
1. Go to LiveGrid in Feature Explorer: http://www.smartclient.com/docs/9.0/a/system/reference/SmartClient_Explorer.html#fetchOperationFS

2. Add groupByMaxRecords: 10000 property to enable grouping.
Code:

isc.ListGrid.create({
    ID:"dsListGrid",
    width: "100%",
    height: "100%",
    autoFitData: "horizontal",
    autoFetchData: true,
    dataSource: "supplyItem",
    groupByMaxRecords: 10000
});

3. Group by 'Category' and execute 'Auto Fit All Columns' from context menu.

'Description' and 'Unit Cost' values are getting clipped instead of expanding to accommodate width of their values (screenshot attached). Without grouping, everything works as expected.
Tested on Firefox 26.0 and Google Chrome 31, both running on Windows 7.

Attached Images
File Type: png clipped_auto_fit_small.png (40.7 KB)

ListGrid stuck in "Data Loading" when fetchData is called before the first finishes

$
0
0
SmartClient Version: v9.0p_2013-11-03/PowerEdition
Browsers: IE 8-10, Chrome 32, probably others

I have a ListGrid that fetches data from a DataSource based on user interaction with other components. Sometimes the user initiates another fetchData before the previous call to fetchData has completed. Whenever this happens the grid gets stuck in a "Loading Data" state.

There are no errors that occur on the server side and I can see the data coming back to the client just fine. The fetchData callback method for both fetchData requests also gets called without a problem. But the ListGrid never displays the rows. It just continues showing the "Loading Data" message.

You can duplicate this behavior by modifying the code in the example:
http://www.smartclient.com/#databoundFetch

Code:

isc.ListGrid.create({
    ID: "countryList",
    width:500, height:224, alternateRecordStyles:true,
    dataSource: worldDS,
    // display a subset of fields from the datasource
    fields:[
        {name:"countryCode"},
        {name:"countryName"},
        {name:"capital"},
        {name:"continent"}
    ],
    sortFieldNum: 1, // sort by countryName
    dataPageSize: 50,
    drawAheadRatio: 4
})

isc.IButton.create({
    left:1, top:240, width:160,
    title:"Fetch Double",
    click: function() {
      countryList.fetchData(
          {continent:'Europe'},
          function(dsResponse, data, dsRequest){
                isc.say('callback 1 '+dsRequest.clientContext.getDataSource().ID);
          },
          {clientContext: countryList}
      );
      setTimeout(function() {
        countryList.fetchData(
            {continent:'Africa'},
            function(dsResponse, data, dsRequest){
                isc.say('callback 2 '+dsRequest.clientContext.getDataSource().ID);
            },
            {clientContext: countryList}
        );
      }, 100);
    }
})

Any suggestions on why this might be happening and the best way to prevent the grid from getting stuck in the "Data Loading" state?

CustomSQL and Velocity variable for DBType.

$
0
0
SmartGWT 4.0

Is there a way to determine the DBType when writing CustomSQL?
We are supporting multiple database products and we have a few minor differences with the custom sql and don't want to maintain duplicate files.
I believe I can do this myself by adding code on the server side to inject this into the $requestAttributes (or other map) on each request but was hoping there was a feature already available.

Mysql ListGrid Date Filtering

$
0
0
Using: v9.0p_2013-10-23/Pro Deployment

I've been banging my head against a wall for a while here, and I know I'm just missing something simple. I've got a datasource hooked up to a table in my mysql backend, and a listgrid bound to this datasource.

All I need to do is to ensure proper filtering of my data. Unfortunately, every way I've tried filtering a date column has not been successful. I understand that only the Power editions and above allow for server-side advanced criteria, but surely there has to be some basic date filtering for the Pro users as well? I just don't understand why the filter editor defaults to sending advanced criteria to the server when it's just sending a simple "equals" request.

So in short, what's the correct setup for date filtering in a listgrid with a mysql backend?

My current ds.xml for this datasource:

Code:

<DataSource ID="event_media" serverType="sql"
            tableName="event_media" autoDeriveSchema="true" useAnsiJoins="true">
            <fields>
                    <field primaryKey="true"
                            name="EventID"                hidden="true"                type="sequence" />
                    <field name="globalEventId" hidden="true" />
                    <field name="Event_DeviceID" foreignKey="drivesafe3.DriveSafe3ID"
                            hidden="true"/>
                    <field includeFrom="vehicle.VehicleName" title="Vehicle"
                            readOnlyEditorType="staticText" canEdit="false" />
                    <field name="DriverID" foreignKey="employee.EmployeeID" hidden="true"/>
                    <field includeFrom="employee.EmployeeName" title="Driver Name"
                            canEdit="false" readOnlyEditorType="staticText"/>
                    <field name="Event_TelemetryRecordsID" hidden="true" />
                    <field includeFrom="drivesafe3.Serial" hidden="true" />
                    <field name="State" title="Status">
                            <valueMap>
                                    <value>New</value>
                                    <value>Reviewed</value>
                                    <value>Coached</value>
                                    <value>User-Triggered</value>
                            </valueMap>
                    </field>
                    <field name="Date" type="date" />
                    <field name="image" hidden="true" />
                    <field name="video" hidden="true" />
                    <field name="videoFileId" hidden="true" />
            </fields>
        <operationBindings>
                <operationBinding operationType="fetch" operationId="fetchReviewed">
                        <criteria fieldName="State" value="Reviewed" />
                </operationBinding>
        </operationBindings>
</DataSource>


What gets sent to the server:
Code:

    criteria:{
        operator:"and",
        _constructor:"AdvancedCriteria",
        criteria:[
            {
                fieldName:"Date",
                operator:"equals",
                value:new Date(1389679200000),
                _constructor:"AdvancedCriteria"
            }
        ]
    },
    operationConfig:{
        dataSource:"event_media",
        operationType:"fetch",
        textMatchStyle:"substring"
    },
    startRow:0,
    endRow:75,
    sortBy:[
        "-timeOfEvent"
    ],
    componentId:"isc_ListGrid_1",
    appID:"builtinApplication",
    operation:"event_media_fetch",
    oldValues:{
        operator:"and",
        _constructor:"AdvancedCriteria",
        criteria:[
            {
                fieldName:"Date",
                operator:"equals",
                value:new Date(1389679200000),
                _constructor:"AdvancedCriteria"
            }
        ]
    }
}


And my error:
Code:

DSRequest for DataSource 'event_media' contained AdvancedCriteria, which the DataSource does not support

bug: ClassFactory.mixInInterface() adds initInterface methods into super class

$
0
0
I am using ClassFactory.mixInInterface to introduce custom initialization code into all Canvases and into DynamicForms.

But SmartClient calls wrong initInterface method for wrong classes. See sample code and explanation below.

Reproducible on SmartClient version 9.0 and 9.0a feature explorer with this sample code.

Code:

isc.defineInterface("CanvasIFace").addInterfaceProperties({
    initInterface : function() {
            //a method which is called before init of all Canvases
            //... in my real implementation there is some code of course
    }
});
isc.ClassFactory.mixInInterface("Canvas", "CanvasIFace");
isc.defineInterface("TestIFace").addInterfaceProperties({
    initInterface : function() {
            alert("TestIFace.initInterface called");
    }
});
isc.ClassFactory.mixInInterface("DynamicForm", "TestIFace");

//The HLayout initialization should call only CanvasIFace.initInterface, but because alert is displayed you can see that it by mistake calls also TestIFace.initInterface
isc.HLayout.create();

In the sample above I do this:
1) define interface "CanvasIFace" with custom initInterface method.
2) mix in interface "CanvasIFace" into "Canvas" class and sub classes. So the CanvasIFace.initInterface method is called before init of Canvas and all sub classes.
3) define interface "TestIFace" with custom initInterface method.
4) mix in interface "TestIFace" into "DynamicForm" class and all sub classes. So the TestIFace.initInterface method should be called before init of DynamicForm and all sub classes.
5) I create HLayout instance. It is sub class of Canvas so CanvasIFace.initInterface is called - OK.
bug: HLayout is not a sub class of DynamicForm so TestIFace.initInterface should NOT be called ... but it is called as alert is displayed.

Fix:
The ClassFactory._mixInProperties have to duplicate content of _initInterfaceMethods and _destroyInterfaceMethods, which are inherited from superclass.

isc.addMethods(isc.ClassFactory, {
//...
_mixInProperties : function (source, destination, asClassProperties) {
//... exising code ...
if (propName == this._initInterfaceMethodName && !asClassProperties) {
// patch any initInterface() methods onto a special array on the classObject to
// be called at class creation.
if (destinationClass._initInterfaceMethods == null) {
destinationClass._initInterfaceMethods = []
} else {
destinationClass._initInterfaceMethods = destinationClass._initInterfaceMethods.duplicate() ;
};
destinationClass._initInterfaceMethods[destinationClass._initInterfaceMethods.length] = propValue;
} else if (propName == this._destroyInterfaceMethodName && !asClassProperties) {
// patch any destroyInterface() methods onto a special array on the classObject to
// be called at class destruction.
if (destinationClass._destroyInterfaceMethods == null) {
destinationClass._destroyInterfaceMethods = [];
} else {
destinationClass._destroyInterfaceMethods = destinationClass._destroyInterfaceMethods.duplicat e();
}
destinationClass._destroyInterfaceMethods[destinationClass._destroyInterfaceMethods.length] = propValue;
}

Thank You for fixing the code :-)
Viewing all 4756 articles
Browse latest View live