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

ListGrid with progressive loading and selected record

$
0
0
<smartgwtVersion>3.1-p20131101</smartgwtVersion>
FF 25,Chrome 31.0.1650.63 m, IE

Hi,

It's about a ListGrid with progressive loading. When scrolling down a chunk of data (75 records) have been fetched automatically and shown by the ListGrid. When select a record and than scroll down, e.g. to record #1000 after the data has been fetched the ListGrid jumps back to the selected record.

Without selecting any record upfront scrolling down works fine.

Unfortunately the code is to complex to extract an example. On the show case tried with the "Live Grid" and there it seems to work properly but the data amount there and the delay are less.

Any idea?

Thanks,

behaviour change for Dynamic form

$
0
0
I just wanted to confirm that this was a fix and is not a bug. If you load the example below using SC 8.3 06-09-2013, the header is displayed to the very right of the page. If you load it using SC8.3 08-18-2013 and newer, the header displays only to the very right of the first column.


Code:


isc.VLayout.create({ID:"vparent", width: "100%", members:[
isc.DynamicForm.create({ID:"GridLayout",name:"GridLayout",styleName:"CwCADS",numCols:1,colWidths:["100"],titleOrientation:"top",margin:0,fields:
[{title:"Right&nbsp;",isFirstFocusable:false,align:"right",showSaveValue:false,ID:"Header",name:"Header",defaultValue:"Right",showValidation:"false",_constructor:"HeaderItem"}]})
]})

Calendar Auto Height

$
0
0
Hi,
I am using a calendar instance in a tabpanel . If I give heigth=400 for the calendar , updates its height, grows/shrinkgs according to its content height.
What I want to do is not give any height to the calendar instance and to make the calendar decide its height according to its content and not show any vertical scroll, because i want my main container to show scrolls.

So far I tried a lot of things, setAutoHeight, setOverflow method but no luck. If I dont give any height than I see only header of the calendar.

how to trigger rollback

$
0
0
Quote:

Originally Posted by LKirsch (Post 113625)
No idea at all?

Hi!

I have almost the same problem, except that my environment is a little bit different (SGWT Power 3.0, GWT 2.3.0, PostgreSQL 9.1).

I have a DMI class with two INSERTs, and if I throw a RuntimeException between those calls, the underyling transaction is nevertheless committed and the result od the first INSERT remains in the database.

I even tried to call this:
return new DSResponse("Some error", DSResponse.STATUS_FAILURE);

but the outcome is the same.

I wonder how can I programmatically trigger rollback in my DMI code?

Does smarclient support Facetchart insde ListGrid

$
0
0
I´m using a licensed SmartClient Version: v9.0p_2013-11-07/Pro Deployment (built 2013-11-07)

Is it possible to render Facetchart as ListGridField item.

Customize SC dialog box style

$
0
0
I'm using SC.warn() and SC.confirm(). I know the dialog box is using the images in sc\skins\Enterprise\images\Window to generate the border.

I would like to know if it's possible to use one set of images for SC.warn() and another set of images for SC.confirm(). I want the border colors to look different.

I can clone the images in that folder and change the color. But I don't know how to make those dialog boxes reference a different set of images.

Similar to the way I override button images using IButton's setSrc("../images/button/button.png").

Thanks.

NullPointerException in Criterion.addCriteria

$
0
0
SmartGWT Version: Smart GWT Pro Edition 4.0p (2013-12-18 nightly)

We are migrating to SmartGWT Pro 4.0 and have encountered a NullPointerException in the com.smartgwt.client.data.Criterion class. In our case the this.getCriteria() call returns null, which causes the "this.getCriteria().length" call in the else block to throw a NullPointerException.

Code:

    public void addCriteria(Criterion c) {
        String opString = this.getAttributeAsString("operator");
        if (opString != null && opString.equals(OperatorId.AND.getValue())) {
            appendToCriterionList(c);
        } else {
                if (this.getAttributeAsObject("value") != null || this.getCriteria().length != 0) {
                Criterion thisCopy = new Criterion(this);
                JSOHelper.deleteAttributeIfExists(jsObj, "fieldName");
                JSOHelper.deleteAttributeIfExists(jsObj, "value");
                Criterion[] criteriaList = { thisCopy, c };
                buildCriterionFromList(OperatorId.AND, criteriaList);                       
            } else {
                buildCriterionFromList(OperatorId.AND, new Criterion[] {c});
            }
        }
    }

    public Criterion[] getCriteria() {
        JavaScriptObject[] jsCriteria = JSOHelper.getAttributeAsJavaScriptObjectArray(getJsObj(), "criteria");
        if (jsCriteria == null) return null;
        Criterion[] criteria = new Criterion[jsCriteria.length];
       
        for (int i = 0; i < jsCriteria.length; i++) {
            criteria[i] = Criterion.getOrCreateRef(jsCriteria[i]);
        }
        return criteria;
    }

TileGrid addData/removeData issue/bug where tile disappears

$
0
0
There seems to be a bug with the SmartClient javascript library for the TileGrid when using removeData and addData functions.

I have a tile grid from which I can remove records and add records. When I remove any record other than the last record and then try to add a record using TileGrid.addData(record), one of the existing tiles disappears.

I have reproduced this bug with one of the SmartClient's showcase examples.

I'm using SmartClient Version: SNAPSHOT_v9.1d_2013-12-11/PowerEdition Deployment 2013-12-11

This bug happens in all the latest browsers: (i.e. Chrome Version 31 on OS:Windows,Mac)

Steps to reproduce the bug:
1. Go to this link: http://www.smartclient.com/docs/9.0/...ingCustomTiles
2. Click on: customTiles.js tab.
3. Delete all javascript code in the scrollable area.
4. Paste code added below in the scrollable area.
5. Click on "Try it".
6. Delete any tile other than the last tile using the remove button on the top right of any tile.
7. Click on any "+" button on the top left of any tile (this will add a brand new tile every time to the TileGrid).
8. Look for the blank space in-between two of the tiles (usually towards the end of the TileGrid).

Code:

isc.TileGrid.create({
    ID:"boundList",
    tileWidth:150,
    tileHeight:205,
    width: "100%",
    height:"100%",
    dataSource:"animals",
    autoFetchData:true,
    animateTileChange:true,
    fields: [
        {name:"picture"},
        {name:"commonName", cellStyle: "commonName"},
        {name:"lifeSpan", formatCellValue: "return 'Lifespan: ' + value;"},
        {  name:"status",
            getCellStyle: function (value, field, record, viewer) {
                if (value == "Endangered") return "endangered";
                else if (value == "Threatened") return "threatened";
                else if (value == "Not Endangered") return "notEndangered";
                else return viewer.cellStyle;
            }
        }
    ],

    getTile : function (record) {
        // override getTile() and add a "Remove" button
        var canvas = this.Super("getTile", arguments);
        canvas.addChild(this.getRemoveButton(this.getRecord(record)));
        canvas.addChild(this.getAddButton(this.getRecord(record)));
        return canvas;
    },
   
    getRemoveButton : function (record) {
        var removeButton = isc.ImgButton.create({
            src: "[SKINIMG]/Tab/left/close.png",
            showHover: true,
            prompt: "Remove tile",
            size: 15,
            showFocused: false,
            showRollOver: false,
            snapTo: "TR",
            showDown: false,
            margin: 2,
            tileGrid: this,
            record: record,
            click : function () {
                animals.removeData(this.record);
            }
        });

        return removeButton;
    },

  getAddButton : function (record) {
        var addButton = isc.Button.create({
            src: "[SKINIMG]/Tab/left/add.png",
            title:'+',
            showHover: true,
            prompt: "Add tile",
            size: 20,
            showFocused: false,
            showRollOver: false,
            snapTo: "TL",
            showDown: false,
            margin: 2,
            tileGrid: this,
            record: record,
            click : function () {
                animals.addData({
                          scientificName : "blah" + Math.random(), picture : "HowlerMonkey.jpg",
                          commonName : "tempTile", lifeSpan : 100, status : "Protected"
                });
            }
        });

        return addButton;
    }

});


performance problem with Canvas.getChildren()

$
0
0
Using SmartGWT-4.0 (released Jul 05, 2013), browser is Chrome v. 31.

While tracking down performance problems within a rather complex SmartGWT application, I noticed that a significant amount of time is spent somewhere inside the Canvas.getChildren() method call. I looked at the source code for that method, and this is using ConvertTo.arrayOfCanvas().

Most of the time is spend doing a call to obj.getAttribute("__ref"), which apparently creates a string representation of something, and compares that with null. It seems to me there might be more optimal ways of doing this check.

Dynamic DS Servlet problem

$
0
0
v9.0p_2013-12-11/PowerEdition Deployment (built 2013-12-11)

Browser: Firefox 25.0.1
System: Win 7, Win 8

I have problem with dynamic ds creation. The problem occurs when MyInitServlet is executed. I keep getting error:
Code:

Problem loading builtinTypes.xml
Exception when loading from __USE_CONTAINER__/com_myproject_ui/sc/system/schema/builtinTypes.xml:
java.lang.NullPointerException
        at com.isomorphic.io.ISCFile.lastModified(ISCFile.java:430)
        at com.isomorphic.store.ProcessedFileCache.getObjectFromFile(ProcessedFileCache.java:140)
        at com.isomorphic.xml.XML.getXMLDocument(XML.java:286)
        at com.isomorphic.xml.XML.toDSRecords(XML.java:294)
        at com.isomorphic.xml.XML.toDSRecords(XML.java:298)
        at com.isomorphic.xml.XML.toDSRecords(XML.java:301)
        at com.isomorphic.datasource.DataSource.<clinit>(DataSource.java:643)
        at com.myproject.ui.server.servlets.MyInitServlet.init(MyInitServlet.java:19)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
        at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:616)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
        at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at org.mortbay.jetty.Server.doStart(Server.java:222)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672)
        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
        at com.google.gwt.dev.DevMode.main(DevMode.java:311)

My web.xml
Code:

<servlet>
                <<servlet-name>MyInitServlet</servlet-name>
                <servlet-class>com.myproject.ui.server.servlets.MyInitServlet</servlet-class>
                <load-on-startup>0</load-on-startup>
        </servlet>


Servlet:
Code:

public class MyInitServlet extends HttpServlet{

        /**
        *
        */
        private static final long serialVersionUID = 1L;
       
        @Override
        public void init() throws ServletException {
            DataSource.addDynamicDSGenerator(new MyDSGenerator());
        }

}

DSGenerator:
Code:

public class MyDSGenerator implements DynamicDSGenerator{
       
       
        @Override
        public DataSource getDataSource(String id, DSRequest dsRequest) {
                DataSource ds=null;
                try {
                        ds = DataSource.fromXML("my ds static input"); //
               
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                return ds;
        }
}

I recompile project after any change.
I'm confused. I couldn't find any working example. Is there anything I'm doing wrong? Or maybe I forgot about smth?

Different behavior between navigators

$
0
0
Hi.
We have some code to capture event keys, specifically, backspace key.
This is the code:
Code:

isc.Page.setEvent("keyPress", keyPressFunction);
function keyPressFunction(){
        if ('Backspace' == isc.Event.getKey())  {
                var item = isc.Event.getActiveElement();

                var cadena = item.isDisabled;
                if (cadena == null || cadena=="undefined" || cadena ){
                        return false;
                }
                var cadena2 = item.isContentEditable;
                if (cadena2 == null || cadena2=="undefined" || !cadena2 ){
                        return false;
                }
                var cadena3 = item.isTextEdit;
                if (cadena3 == null || cadena3=="undefined" || !cadena3 ){
                        return false;
                }

                return true;
        }
}

The matter is: when we test this on a I.Explorer 10.0.9200.16750, works perfectly.
But when test this on a Google Chrome Versión 31.0.1650.63, backspace doesn't remove the letter written.
Since there is only smartclient code, I guess this code, should works in the same way on both (or more) navigators...
ok or wrong, but same behaviour on both sides, doesn't it?...
Could be this a (little) bug?
Thanks in advance.

We are working under:
v9.0p_2013-08-20/PowerEdition Development SC and IExplrorer 10.0.9200 navigator, Eclipse Helios and Tomcat 7.0.28

How to create cilent side pager in smart Client

$
0
0
Hello ,

How can we create client Side Pager in smart client.
I am using JAX-RS and setting the data on the list gird (Not using Data Source).
I want to give page in the list gird.

I am using following :
smartClient 8.3 version
IE8/Chrome/Mozila Firfox 10.

Default value in a datasource field

$
0
0
Hello,

I wish to specify a default value for a not-null database field and I don't find where I can do it.

Regards

Performance issue when combining userFormulas, grouping, and summaries

$
0
0
Hi guys,

We've been struggling with some performance problems for some of our users for a few months now. And, I'm finally making some headway into understanding the problem. I'm hoping you can provide some guidance. This is somewhat urgent because we've developed some frustrated users.

Here is the deal. These users have a list grid with the following

1. User defined hilites

2. About 10 user formulas...several formulas referring to other formulas

3. Grouping that typically results in 10-15 different groups

4. Grid summaries showing 3 summary rows and Group summaries also showing 3 summary rows for each group.

After debugging today, I realize the combination of all this functionality is the root of the problem. It seems when summary rows are recalculated, each unique summary row is causing the groupTreeChanged event to fire on the grid as a whole. And, each time the groupTreeChanged event fires, applylHilites is called every time. When applyHilites is called, every formula is recalculated. So, this appears to be a cascading chain of events that is causing significant slowness.

If we remove the grid and group summaries, the app speeds up significantly. If we reduce the number of summary rows on the grid and the group from 3 rows to 1, it also speeds up significantly. If we remove grouping, again it speeds up. If we change grouping so that it is only 1 or 2 groups instead of 10, again improvement. If we remove hilites, big improvement. But, the requirement for our users is to be able to combine all of these features into their grids.

So, it seems like the root of the problem is that the groupTreeChanged event is firing every time a summary row is updated. But, there may be other ways to improve this such as not re-calculating formulas every time we applyHilites if possible. I can send you a google chrome cpu profile showing what it looks like when CPU on a client machine has been pegged as a result of this problem if that is helpful.

Please let me know what you think. Hopefully that gives you enough detail to understand the issue. I started to try re-producing the setup above with one of your examples like this one: http://www.smartclient.com/#summaryGridFS but wasn't sure how to use that example to demonstrate the firing of groupTreeChanged over and over again.

ListGrid with progressive loading and selected record

$
0
0
Hi,

could you please look at this problem again?

I opened a new thread because I'm not sure if you already closed the old one.

http://forums.smartclient.com/showthread.php?t=28928

Thanks,
zapryano

Tile Grid Editable Item

$
0
0
Hi I am Using SmartGWT

I have tile Grid. On each Tile I do have Form with Text Item.

I am trying to set Text Item in canvas as follows
TextItem textItem = new TextItem();

canvas.setAutoChildProperties("TEXT1Child",textIte m);

But while trying to get using tile.getFormItemAutoChild("TEXT1Child") it is throwing exception.


Please let me know where I am going wrong.

How to set and get AutoChildProperties

$
0
0
Hi,

I am using SmartGWT Version "v9.0p_2013-12-14/PowerEdition Deployment"

While creating TileGrid I override getTile and in which I am trying to set The AutoChildProperties. like

canvas.setAutoChildProperties("lngOrderedQty1",FOR MITEM);

Not able to get using...

tile.getFormItemAutoChild("lngOrderedQty1") OR
tile.getCanvasAutoChild("lngOrderedQty1")

Both method is throwing exception.

if I check object I do see the "lngOrderedQty1"Properties

canvas object is like

SimpleTile{creator: [TileGrid ID:isc_FWInitializer_1_0],
ID: "isc_FWInitializer_1_0_tile_1",
tileNum: 1,
canHover: true,
position: "absolute",
className: "simpleTileSelected",
width: 180,
height: 150,
left: 224,
top: 5,
styleName: "simpleTileSelected",
showDown: false,
lngOrderedQty1Properties: Obj{ID:isc_DynamicForm_11},
children: Array[3],
border: "1px solid black",
padding: 2,
parentElement: [TileGrid ID:isc_FWInitializer_1_0],
topElement: [SectionStack ID:isc_SectionStack_0],
cacheOffsetCoords: true,
zIndex: 200414,
selected: true,
}


Please suggest.

Regards,
DSingh

showValueOnHover for facet charts

$
0
0
Hello,

We'd like to format the value that is displayed in charts on showValueOnHover. Or, if that is not possible, have the output of getPointHoverHTML behave the same as the value displayed on hover. Right now, the user ends up seeing two different hovers. They see one value when they hover near a data point and then a second when they hover directly over the data point. We'd like just one hover that we can format that displays when they hover near a data point and the same hover when hovering over the data point. Is that possible?

sortNormalizer and grid.sort()

$
0
0
smartgwt pro-4.0p / SmartClient Version: v9.0p_2013-10-01/Pro Deployment (built 2013-10-01)

Calling sort() on a ListGrid do alphabetical sorting instead of the sort order defined with setSortNormalizer on the same column. Clicking on the on the column sorting on the screen I get the right (normalized) order. Is there any way to get the right order without manual click?

DynamicForm itemChange event not fired when using korean language

$
0
0
Hi Isomorphic team and others.

I'm working with
1. SMARTCLIENT SNAPSHOT_v9.1d_2013-12-04
2. IE8
3. language : KOREAN

dynamicForm.itemChange event not fired when using korean language.
but using numberkey or english work fine.
and my Crome browser(version 31.0.1650.63 m) working well.


thanks a lot.
Viewing all 4756 articles
Browse latest View live