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

Navigation among tabs when closing tab

$
0
0
Hi.

I have created a tabSet with several closeable tabs, and I need to change default behavior of closing a tab.

When I close the current selected tab, the next selected tab is tab0, which is ok. But when I close another tab (no selected), the next selected tab is tab0 again, which is wrong. In this last case I want tabSet to remain in current selected tab.

I have added a CloseClickHandler to my Tabset, in order to avoid this, but the result is the same. I have detected that if I cancel this CloseClickEvent, my tabSet goes to tab0 and then returns to the tab I tried to close.

My project references GWT 2.0.5, smartgwt 3.1 and smartgwt-skins 3.1.

What can I do? Thanks in advance.

SmartGWT Mobile DynamicForm focus

$
0
0
Is there a way to set a TextItem (or other element) to have the focus (and have the keyboard automatically appear) inside a DynamicForm? In SmartGWT this can be done using the DynamicForm.focusInItem method but that doesn't seem to exist in Mobile SmartGWT.

Thanks,
Julian

Context menu for ListGrid overlapping on header menu

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

When a listgrid has a context menu associated, it is also displayed with right-clicking on a column header. Previously, in version 4.0 (and before), the context menu associated with a listgrid would only show when clicking inside the list of rows. This has the effect of popping up two menus when right-clicking on a column header - the header context menu with the listgrid context menu overlapped on top.

Using the CustomDS sample, I was able to reproduce this by adding a context menu to the list grid:

Code:

package com.smartgwt.sample.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.fields.*;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.layout.VStack;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.MenuItemIfFunction;
import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
import com.smartgwt.client.widgets.viewer.DetailViewer;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class CustomDS implements EntryPoint {
    private ListGrid boundList;
    private DynamicForm boundForm;
    private IButton saveBtn;
    private DetailViewer boundViewer;


    /**
    * This is the entry point method.
    */
    public void onModuleLoad() {

       
                KeyIdentifier debugKey = new KeyIdentifier();
                debugKey.setCtrlKey(true);
                debugKey.setKeyName("D");

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

        // instantiate DataSource on the client only (this example explicitly bypasses
        // ISC server-side DataSource management)

        DataSource dataSource = new DataSource();
        dataSource.setDataURL(GWT.getModuleBaseURL() + "/supplyItemOperations.rpc");
        dataSource.setID("supplyItem");

        DataSourceSequenceField itemID = new DataSourceSequenceField("itemID");
        itemID.setPrimaryKey(true);
        itemID.setHidden(true);

        DataSourceTextField itemName = new DataSourceTextField("itemName", "Item", 128, true);

        DataSourceTextField SKU = new DataSourceTextField("SKU", "SKU", 10);
        //SKU.setCanFilter(false);

        DataSourceTextField description = new DataSourceTextField("description", "Description");       
        DataSourceTextField category = new DataSourceTextField("category", "Category", 128);
        DataSourceTextField units = new DataSourceTextField("units", "Units", 5);

        DataSourceFloatField unitCost = new DataSourceFloatField("unitCost", "Unit Cost");
        DataSourceBooleanField inStock = new DataSourceBooleanField("inStock", "In Stock");

        DataSourceDateField nextShipment = new DataSourceDateField("nextShipment", "Next Shipment");

        dataSource.setFields(itemID, itemName, SKU, description, category, units, unitCost, inStock, nextShipment);


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

        Label label = new Label();
        label.setContents("<ul>" +
                "<li>click a record in the grid to view and edit that record in the form</li>" +
                "<li>click <b>New</b> to start editing a new record in the form</li>" +
                "<li>click <b>Save</b> to save changes to a new or edited record in the form</li>" +
                "<li>click <b>Clear</b> to clear all fields in the form</li>" +
                "<li>click <b>Filter</b> to filter (substring match) the grid based on form values</li>" +
                "<li>click <b>Fetch</b> to fetch records (exact match) for the grid based on form values</li>" +
                "<li>double-click a record in the grid to edit inline (press Return, or arrow/tab to another record, to save)</li>" +
                "</ul>");
        vStack.addMember(label);
       
        Menu contextMenu = new Menu();
       
        MenuItem[] items = new MenuItem[] {
                        createMenuItem("red"),
                        createMenuItem("blue")
        };
        contextMenu.setItems(items);
       
        boundList = new ListGrid();
        boundList.setHeight(200);
        boundList.setCanEdit(true);
        boundList.setContextMenu(contextMenu);
        boundList.setDataSource(dataSource);

        boundList.addRecordClickHandler(new RecordClickHandler() {
            public void onRecordClick(RecordClickEvent event) {
                Record record = event.getRecord();
                boundForm.editRecord(record);
                saveBtn.enable();
                boundViewer.viewSelectedData(boundList);
            }
        });
        vStack.addMember(boundList);

        boundForm = new DynamicForm();
        boundForm.setDataSource(dataSource);
        boundForm.setNumCols(6);
        boundForm.setAutoFocus(false);
        vStack.addMember(boundForm);

        ToolStrip toolbar = new ToolStrip();
        toolbar.setMembersMargin(10);
        toolbar.setHeight(22);

        saveBtn = new IButton("Save");
        saveBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                boundForm.saveData();
                if (!boundForm.hasErrors()) {
                    boundForm.clearValues();
                    saveBtn.disable();
                }
            }
        });
        toolbar.addMember(saveBtn);

        IButton clearBtn = new IButton("Clear");
        clearBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                boundForm.clearValues();
                saveBtn.disable();
            }
        });
        toolbar.addMember(clearBtn);

        IButton filterBtn = new IButton("Filter");
        filterBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                boundList.filterData(boundForm.getValuesAsCriteria());
                saveBtn.disable();
            }
        });
        toolbar.addMember(filterBtn);

        IButton fetchBtn = new IButton("Fetch");
        fetchBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                boundList.fetchData(boundForm.getValuesAsCriteria());
                saveBtn.disable();
            }
        });
        toolbar.addMember(fetchBtn);

        IButton deleteBtn = new IButton("Delete");
        deleteBtn.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                boundList.removeSelectedData();
                boundList.deselectAllRecords();
            }
        });
        toolbar.addMember(deleteBtn);

        vStack.addMember(toolbar);

        boundViewer = new DetailViewer();
        boundViewer.setDataSource(dataSource);
        vStack.addMember(boundViewer);

        vStack.draw();

        boundList.filterData(null);
    }

    private MenuItem createMenuItem(final String color) {
                MenuItem item = new MenuItem(color);
                item.setCheckIfCondition(new MenuItemIfFunction() {
                        @Override
                        public boolean execute(Canvas target, Menu menu, MenuItem item) {
                                return (target.getBackgroundColor() == color);
                        }
                });
                item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                        @Override
                        public void onClick(MenuItemClickEvent event) {
                                // We set the background color in the ordinary way,
                                // and then use updateEditNode() to record
                                // the state just-in-time, when serialization occurs
                                event.getTarget().setBackgroundColor(color);
                        }
                });
                return item;
        }
}

UI Problems in grid in edition mode

$
0
0
UI Problems in grid in edition mode in all browsers in the latest 10.0d version (and also at least in 13-Feb).

With the following html:

https://mega.co.nz/#!0QwQHLID!MT8sYEUm0qy6eFN3EKh45CkIdhkZmgQ--Y37RmlEqs4

if you open

http://localhost:8080/isomorphic/system/reference/IssueTestResizing.html

When you double click a row (go to edition mode) you can notice that the combo icon button is cutted. If you resize the columns, then it is shown.

In our application we have also another issue that can not be perceived in the previous html that is that also once it goes to edition mode, the inputs are moved some few pixels to the left. Once you resize, they go to the proper place.

Here it is also a video showing the issues in our instance and in the basic IssueTestResizing.html example:

http://screencast.com/t/ofg6djnp

Thanks and regards.

TreeGrid.setData(Tree) question

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

I followed the example on the Isomorphic Wiki on doing refreshes with a ListGrid using the DataSource to fetch and then doing a listgrid.setData().

I'm seeing instances of ListGridRecord(s) being accumulated with every TreeGrid.setData(Tree). With a fixed data set of 22k compressed being sent every time, after 70 refreshes the browser falls over and hangs.

Should I be clearing the TreeGrid first before doing a TreeGrid.setData(Tree)?

FilterEditor disappears when the delete button column is clicked.

$
0
0
- SmartClient Version: v9.1p_2014-03-06/LGPL Development Only (built 2014-03-06)
- Tested on Firefox 24, Chromium 32

For grids that display the filter editor and allow the removal of records, there exists a space on the filter editor that, if clicked, makes the filter editor disappear.

The space is between the last filter box and the funnel icon, right above the delete button column. I've included a test case with a blank grid.

Code:

public class Main implements EntryPoint {
        @Override
        public void onModuleLoad() {               
                final ListGrid grid = new ListGrid(){{
                        setFields(new ListGridField("id", "Id"), new ListGridField("name", "Name"));
                        setHeight100();
                        setShowFilterEditor(true);
                        setCanRemoveRecords(true);                       
                }};
                VLayout vLayout = new VLayout();
                vLayout.setMembersMargin(15);
                vLayout.addMember(grid);
                vLayout.setHeight100();
                vLayout.setWidth100();
                vLayout.draw();
        }
}

smartgwt mobile social component

$
0
0
hi :
<p>
<strong>examp</strong>
<button id="delTokenBtn">quit</button>
<div id="delTokenInfo"></div>
</p>
<pre><code>
$("#delTokenBtn").click(function(){
var info = $.fn.umshare.delToken("facebook");
$("#delTokenInfo").html('quit success');
});
</code></pre>

i want add social share function to my project,and i found one phonegap plugin to achieve it,see the above code
To the problem,the smartgwt.mobile output code was confused,can't add click handler on one button?
does other solutions,or use smartgwt.mobile with java code?

thank you



oh i see the gwt compile setting to change obfusecate to pretty to see the code

Component Id For YES and NO Buttons on Confirmation Dialog

$
0
0
Hi,
I am using SmartGwt-4.0p.
I wants to set an unique component id for YES and NO Buttons on Confirmation Dialog.

Dialog :

SC.ask(resourceString.getLocalizedString("Please Confirm...!",
new BooleanCallback() {

@Override
public void execute(Boolean value) {
if (null != value && value) {
//Code
} });

I used the following code to set the id.
It is not affecting the Ids to the corresponding buttons.
Example :
Dialog.YES.setID("page_QuestionDialog_Confirmation _YES_11");
Dialog.NO.setID("page_QuestionDialog_Conforirmatio n_NO_12");
Is this correct approach what I used ?
If not, Please give me solution for achieving this.

Thanks.

Issue after using SmartGWT 3.1 eval version

$
0
0
Hi,

I am getting below exception while calling draw on some of the VLayouts.

Code:

com.google.gwt.core.client.impl.SerializableThrowable$ThrowableWithClassName: (TypeError) @com.smartgwt.client.widgets.BaseWidget::draw()([]): _5 is undefined
        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.invokeNativeVoid(ModuleSpace.java:299)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)

I tried using developer console, but above error is not getting logged there.

SGWT Version : v8.3p_2014-03-22/EVAL Deployment
Browser : FF 21

Please note that it works fine if I use SmartGWT 3.1 LGPL version. But I am evaluating because I want to buy the PRO version.
Please help.

I can not select text in a ListGrid with Chrome

$
0
0
Hi,

I am using SmartGwt-4.0p.

Code:

listTextos = new ListGrid();
listTextos.setSelectionType(SelectionStyle.SINGLE);
listTextos.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
listTextos.setCanSelectAll(true);
listTextos.setCanSelectText(true);
listTextos.setCanDragSelectText(true);
listTextos.setShowHeader(false);     
listTextos.setAutoFetchData(false);
listTextos.setDataSource(dsTextos);
listTextos.setCanEdit(false);
listTextos.setShowAllRecords(true);
listTextos.setWrapCells(true);
listTextos.setFixedRecordHeights(false);
listTextos.setEmptyMessage("<i>No hay textos disponibles para esta anotación.</i>");
listTextos.setFields(getListGridFields());
listTextos.addSelectionChangedHandler(new SelectionChangedHandler() {
            @Override
            public void onSelectionChanged(SelectionEvent event) {
                if (event.getState()) {                 
                    //Edición
                    if (event.getRecord().getAttribute("usu_modificacion").compareTo(operador.getAlias()) == 0) {
                        grTextos.setDisabledEditar(false);
                    } else {
                        grTextos.setDisabledEditar(true);
                    }
                } else {
                    grTextos.setDisabledEditar(true);
                }
            }
        });

The control listGrid only has a visible column that I formatted content in a html table.
Code:

private ListGridField[] getListGridFields() {

        List<ListGridField> listGridFields = new ArrayList<ListGridField>();

        //idTexto
                ListGridField idTexto = new ListGridField("id_texto", "IdTexto");
                idTexto.setHidden(true);
                idTexto.setCanHide(false);               
        listGridFields.add(idTexto);

        //Texto
                ListGridField texto = new ListGridField("texto", "Texto");
                texto.setWidth("*");
                texto.setType(ListGridFieldType.TEXT);
                texto.setCellFormatter(new CellFormatter() {
                        @Override
                        public String format(Object value, ListGridRecord record, int rowNum, int colNum) {

                                String sTexto = "<table width='100%'>";

                                // <editor-fold defaultstate="collapsed" desc="Row 1">

                                sTexto += "<tr style='background-color:#FCF0AD'>";
                                sTexto += "<th text-align='left' width='10%'>" + "De:" + "</th>";
                                sTexto += "<td width='25%'>";
                                sTexto += record.getAttribute("usu_modificacion") + " (" + record.getAttribute("gop_padre") + ")";
                                sTexto += "</td>";
                                sTexto += "<th text-align='left' width='10%'>" + "Fecha:" + "</th>";
                                sTexto += "<td width='25%'>" + record.getAttribute("fecha") + "</td>";
                                sTexto += "<th text-align='left' width='10%'>" + "Tipo:" + "</th>";
                                sTexto += "<td width='20%'>" + record.getAttribute("tipo") + "</td>";
                                sTexto += "</tr>";

                                // </editor-fold>

                                // <editor-fold defaultstate="collapsed" desc="Row 2">

                                if (EnumSiNo.getItem(record.getAttribute("visible"))) {
                                        sTexto += "<tr style='background-color:#FCF8E1'>";
                                } else {
                                        sTexto += "<tr>";
                                }
                                sTexto += "<td colspan= '6'>" + String.valueOf(value) + "</td>";
                                sTexto += "</tr>";

                                // </editor-fold>

                                sTexto += "<hr>";
                                sTexto += "</table>";

                                return sTexto;
                        }
                });
               
                listGridFields.add(texto);

        return listGridFields.toArray(new ListGridField[listGridFields.size()]);
}

In FF and IE if I select the text (FF.png), however in Chrome if I try dragging select a word, just select a letter and can not select more content (Chrome.png).

Attached Images
File Type: png FF.png (36.6 KB)
File Type: png Chrome.png (30.3 KB)

Building SmartGWT Mobile app with Maven

$
0
0
I'm trying to build my SmartGWT Mobile web application using Maven but I'm getting errors. I've done this previously using SmartGWT and didn't have any issues. This web application builds properly from within Eclipse using the GWT plugin.

I'm using GWT 2.5.1 and SmartGWT Mobile 1.0d2014-03-26.

Here is the error from Maven:

Code:

[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Not compiling test sources
[INFO] [surefire:test {execution: default-test}]
[INFO] Tests are skipped.
[INFO] [gwt:compile {execution: default}]
[INFO] Compiling module com.isigp.capture.CaptureImage
[INFO]    Computing all possible rebind results for 'com.smartgwt.mobile.client.widgets.icons.IconResources'
[INFO]      Rebinding com.smartgwt.mobile.client.widgets.icons.IconResources
[INFO]          Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
[INFO]            [ERROR] Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding 'com.smartgwt.mobile.client.widgets.icons.IconResources'
[INFO] java.lang.NullPointerException
[INFO]        at com.google.gwt.resources.rg.ImageResourceGenerator$BundledImage.addImage(ImageResourceGenerator.java:99)
[INFO]        at com.google.gwt.resources.rg.ImageResourceGenerator.prepare(ImageResourceGenerator.java:543)
[INFO]        at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1013)
[INFO]        at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1039)
[INFO]        at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.generateIncrementally(AbstractClientBundleGenerator.java:419)
[INFO]        at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:651)
[INFO]        at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
[INFO]        at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
[INFO]        at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
[INFO]        at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
[INFO]        at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
[INFO]        at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleGwtCreate(UnifyAst.java:355)
[INFO]        at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:433)
[INFO]        at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:237)
[INFO]        at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:243)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO]        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:116)
[INFO]        at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:65)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO]        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:116)
[INFO]        at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:48)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:170)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:336)
[INFO]        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:137)
[INFO]        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:133)
[INFO]        at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:82)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO]        at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:434)
[INFO]        at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:403)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]        at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO]        at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:900)
[INFO]        at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:625)
[INFO]        at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:640)
[INFO]        at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
[INFO]        at com.google.gwt.dev.Precompile.precompile(Precompile.java:278)
[INFO]        at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO]        at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
[INFO]        at com.google.gwt.dev.Compiler.run(Compiler.java:232)
[INFO]        at com.google.gwt.dev.Compiler.run(Compiler.java:198)
[INFO]        at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
[INFO]        at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
[INFO]        at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
[INFO]        at com.google.gwt.dev.Compiler.main(Compiler.java:177)
[INFO]    [ERROR] Errors in 'com/smartgwt/mobile/client/widgets/icons/IconResources.java'
[INFO]      [ERROR] Line 29: Failed to resolve 'com.smartgwt.mobile.client.widgets.icons.IconResources' via deferred binding
[INFO]    Computing all possible rebind results for 'com.smartgwt.mobile.client.internal.theme.iphone.ThemeResourcesIPhone'
[INFO]      Rebinding com.smartgwt.mobile.client.internal.theme.iphone.ThemeResourcesIPhone
[INFO]          Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
[INFO]            [ERROR] Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding 'com.smartgwt.mobile.client.internal.theme.iphone.ThemeResourcesIPhone'
[INFO] java.lang.NullPointerException

Persisting visibility property in use of EditContext & EditNode

$
0
0
Hi

SmartClient v9.1p_2014-03-25/Enterprise Deployment (2014-03-25)

Chrome Version 33.0.1750.154 m
Chromium 18.0.1004.0 (Developer Build 117091 Windows)


I am trying to build up what will eventually become a complex
collection of instances of SmartClient classes (each wrapped in an
EditNode) whose state needs to be persistable using a common global
EditContext to which they are all added.

In trying to do this for a more complicated structure than i present
below, i encountered a problem that the visibility property of the
various objects involved (whose "inherit" vs "hidden" value i rely on
for certain functionality) is not preserved across a "reincarnation"
of the object collection.

The code i present below is a very stripped-down version of the sort
of system i need to work with, which illustrates:

- in microcosm how i'm using the EditContext and EditNode
functionality,
- what specifically i'm trying but currently failing to accomplish.
- how i'm implementing reincarnation.
- how reincarnation interferes with the state of the system and causes
the functionality to break.

The code is a qunit test which interleaves a sequence of actions and
state checks. Between actions, certain things about the state should
be true. A reincarnate is just a special kind of action which is
supposed in all circumstances to preserve the state of the system.

We can see that if all the reincarnate actions are commented out, that
all the tests pass. If we uncomment either or both of the reincarnate
actions that could be performed when the system is in the "shown"
state (i.e., the first and third), then all the tests continue to
pass. But if we uncomment the reincarnate action that could be
performed when the system is in the "hidden" state (the second), then
the test immediately following it fails. And this is because the
second reincarnation fails to preserve the fact that the visibility
property of the Canvas should be "hidden", instead of being
reincarnated with this property reverted to "inherit".

What can you suggest i fix about how i'm using your
EditContext/EditNode functionality to allow the current state of a
built-in property like visibility to be persisted in a manner that
will allow these tests to pass with the second reincarnate action
uncommented?

What other general recommendations can you make about how i should
change the way i am trying to use this functionality?

SCP_ForumATest.html:
Code:

<!DOCTYPE html>
<html>
  <head>
    <title>ForumATest</title>
    <script>var isomorphicDir = "isomorphic/";</script>
    <script src="isomorphic/system/modules-debug/ISC_Core.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Foundation.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Containers.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Grids.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Forms.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_DataBinding.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Drawing.js"></script>
    <script src="isomorphic/system/modules-debug/ISC_Charts.js"></script>
    <script src="isomorphic/system/development/ISC_Tools.js"></script>
  </head>
  <body>
    <div id="qunit" style="display:block"></div>
    <div id="qunit-fixture" style="display:block"></div>
    <script src="js/qunit.js"></script>
    <link rel="stylesheet" href="js/qunit.css">
    <script src="SCP_ForumATest.js"></script>
  </body>
</html>

SCP_ForumATest.js:
Code:

test("persistingVisibility", function(assert){
   
    Fixture = {
        editPane : isc.EditPane.create({}),
        getLiveObjectArray : function() {
            return Fixture.editPane.getEditNodeTree().getChildren().map(function(x){return x.liveObject;});
        },
        serialize : function() {
            return Fixture.editPane.serializeAllEditNodesAsJSON(false);
        }
    };
   
    ClassFactory.defineClass("SCP_CanvasA",isc.Canvas).addProperties({
        initWidget : function(args) {
            this.Super("initWidget", arguments);
        }
    });
   
    ClassFactory.defineClass("SCP_LayoutA",isc.Layout).addProperties({
        initWidget : function(args) {
            this.Super("initWidget", arguments);
            var canvasNode = Fixture.editPane.makeEditNode({type:"SCP_CanvasA",defaults:{backgroundColor:"#070",width:90,height:90}});
            this.canvas = canvasNode.liveObject;
            this.addMember(this.canvas);
            Fixture.editPane.addNode(canvasNode,undefined,undefined,undefined,true);
            this.show();
        },
        showCanvas : function() {
            this.canvas.show();
        },
        hideCanvas : function() {
            this.canvas.hide();
        }
    });
   
    TestSequenceA = {
       
        actionCreate : function(liveObjectArray) {
            var layoutNode = Fixture.editPane.makeEditNode({type:"SCP_LayoutA",defaults:{backgroundColor:"#700",width:100,height:100}});
            Fixture.editPane.addNode(layoutNode,undefined,undefined,undefined,true);
        },
       
        actionShow : function(liveObjectArray) {
            var layout = liveObjectArray.filter(function(x){ return x.isA("SCP_LayoutA"); });
            layout[0].showCanvas();
        },
       
        actionHide : function(liveObjectArray) {
            var layout = liveObjectArray.filter(function(x){ return x.isA("SCP_LayoutA"); });
            layout[0].hideCanvas();
        },
       
        checkShownState : function(liveObjectArray) {
            var layout = liveObjectArray.filter(function(x){ return x.isA("SCP_LayoutA"); });
            equal(layout[0].canvas.visibility,isc.Canvas.INHERIT,"canvas should be visible");
        },
       
        checkHiddenState : function(liveObjectArray) {
            var layout = liveObjectArray.filter(function(x){ return x.isA("SCP_LayoutA"); });
            equal(layout[0].canvas.visibility,isc.Canvas.HIDDEN,"canvas should be invisible");
        }
    };
   
    var reincarnate = function(s11n) {
        ok(true,"before reincarnation, serialization=="+Fixture.serialize() );
        Fixture.editPane.destroyAll();
        ok(true,"during reincarnation, serialization=="+Fixture.serialize() );
        Fixture.editPane.addPaletteNodesFromJSON(s11n);
        ok(true," after reincarnation, serialization=="+Fixture.serialize() );
    };
   
    TestSequenceA.actionCreate        (Fixture.getLiveObjectArray());
    TestSequenceA.actionShow        (Fixture.getLiveObjectArray());
   
    TestSequenceA.checkShownState        (Fixture.getLiveObjectArray());
    // reincarnate                        (Fixture.serialize()); // first
    TestSequenceA.checkShownState        (Fixture.getLiveObjectArray());
   
    TestSequenceA.actionHide        (Fixture.getLiveObjectArray());
   
    TestSequenceA.checkHiddenState        (Fixture.getLiveObjectArray());
    // reincarnate                        (Fixture.serialize()); // second
    TestSequenceA.checkHiddenState        (Fixture.getLiveObjectArray());
   
    TestSequenceA.actionShow        (Fixture.getLiveObjectArray());
   
    TestSequenceA.checkShownState        (Fixture.getLiveObjectArray());
    // reincarnate                        (Fixture.serialize()); // third
    TestSequenceA.checkShownState        (Fixture.getLiveObjectArray());
   
});

Synchronize several DMI calls

$
0
0
Assuming there is no way to do this nesting callbacks of DMI:
What should be the way to achieve a sequential and ordered DMI calls?
I mean, if you have three independent dmi calls, how can I get that the second dmi call, doesn't begin to execute after the first dmi callback has finished completely?
And so with the second and third dmi call...


We are working under:
v9.1d_2014-02-22/PowerEdition Development SC and IExplrorer 10.0.9200 navigator, Eclipse Helios and Tomcat 7.0.28

smartclient server separate host from smartclient client html/js

$
0
0
Looking at a possible 3 host setup:

host 1. Apache webserver for html and the client side isomorphic js libraries, skins etc.

host 2. Tomcat server for the smartclient server side java stuff

host 3. MySQL server to persist the data.

Question: How to I pass the address of host 2 to the clients so that they can talk to the server side java. The examples all seem to assume that the client side html and the server java live on one host under one webroot.

I'm suspect I'm missing a simple config item somewhere.

Thanks
Russ Poyner

DebugMode - finding fieles problem

$
0
0
version:
SNAPSHOT_v9.1d_2013-12-30/PowerEdition Deployment (built 2013-12-30)
Firefox 25

Hi,
having some issues with debugmode
Code:

=== 2014-03-28 18:53:03,923 [l0-6] INFO  RequestContext - URL: '/com_evizone_rbp_ui/sc/skins/Enterprise/load_skin.js', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0': Moz (Gecko) with Accept-Encoding header
=== 2014-03-28 18:53:03,924 [l0-6] INFO  Download - File null/com_evizone_rbp_ui/sc/skins/Enterprise/load_skin.js not found, sending 404
[WARN] 404 - GET /com_evizone_rbp_ui/sc/skins/Enterprise/load_skin.js (127.0.0.1) 1437 bytes
  Request headers
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
      Accept: */*
      Accept-Language: pl,en-us;q=0.7,en;q=0.3
      Accept-Encoding: gzip, deflate
      Referer: http://127.0.0.1:8888/Com_evizone_rbp_UI.html?gwt.codesvr=127.0.0.1:9997

During startup the app can't find the right path to different files (ds.xml and files from sc path), searching in "null" webRoot:
Code:

Download - File null/com_evizone_rbp_ui/sc/skins/Enterprise/load_skin.js
the wierd thing is that ther seems to be no problem with my other files like imiges or WEB-INF
Code:

webRoot: __AUTODETECT__
datasources.pool.enabled=true
isomorphicPathRootRelative: $gwtModuleName/sc
project.datasources: $webRoot/ds
project.ui: $webRoot/shared/ui
project.apps: $webRoot/shared/app
skin.skin_styles.location: Com_evizone_rbp_UI.css

autodetect is working fine
Code:

- Auto-detected webRoot - using: D:\Eviroth 2\eviroth-web\src\main\webapp
The app is runing "fine" but without stylling/skin graphics and DS. Entering the abosulte path by hand, does not solve the problem.

ListGrid select with more than 10000 rows (without progressive loading)

$
0
0
We have a ListGrid that loads data of around 20k records.
Each row a checkbox on the first column of the row.

We also have a checkbox item on top of the grid which is named
Select All.

Now when i select Select All checkbox we make sure all the check boxes in the individual rows (20K+) are checked by using the following code.
Code:

private void selectGridRows(boolean select){
                for(int i=0; i < grid.getTotalRows(); i++){
                        if(grid.getEditedRecord(i).getAttribute(gridDataSource.someColumn) == null){
                                if(select){
                                        grid.selectRecord(i);
                                }else{
                                        grid.deselectRecord(i);
                                }
                                grid.setEditValue(i, 0, select);
                                grid.refreshRow(i);
                        }
                }
}

However this seems not working because we are progressively loading the data into the ListGrid in multiples of (75). Hence we selectAll is clicked only those which are in the viewport are selected.

Even if we were to issue a row count query and udpate the totalRows (20K+) , As it is a huge dataset, dragging the scrollbar to the end is blocking the page completely and very slow.

Only possible solution we are thinking as of now is when user selects Select All checkbox and when we knew that only 75 odd rows have been selected , we will the id (by which the 20k rows are fetched) to the server and processing it.

Is there any other way that i can achieve this task of selecting all the records at one go when user selects Select All checkbox.

SmartClient version:
SC_SNAPSHOT-2011-12-05/LGPL Development Only (built 2011-12-05)
Browser : Chorme 32.0.1/Firefox 26

duplicate entries in my select distinct SelectItem

$
0
0
Hi,

I'm using SmartClient Version: v8.3p_2014-03-06/PowerEdition Deployment (built 2014-03-06) (SmartGWT 3.1p) with PostgreSQL 9.2.2, Firefox 26.0, and Tomcat 7.0.33.

I have a SQL dataSource with a bunch of fields including a field called 'cycle'. The dataSource supports some listGrids and it also supports a SelectItem for the 'cycle' field. Since the 'cycle' field can have duplicates I defined a special operationBinding for the SelectItem which does a select distinct. The operation binding looks like:
Code:

<field name="cycle"    type="text"    title="Billing Cycle"  />
...
<binding operationType="fetch" operationId="comboBoxCycleList" outputs="cycle">
              <selectClause>distinct cycle</selectClause>
              <orderClause>cycle</orderClause>
              <whereClause>cycle is not null</whereClause>
</binding>

I define the SelectItem this way:
Code:

cycle = new SelectItem("cycle");
cycle.setDisabled(false);
cycle.setOptionDataSource(asdDS);
cycle.setOptionOperationId("comboBoxCycleList");

All this seems to work fine. I can see the dataSource entries in listGrids. I can add, edit and delete entries. I can access the SelectItem and see the distinct list of cycles.

I have a problem with the SelectItem list if a entry is added to the dataSource with an existing cycle number. The add is done with the default add operation. It looks like the cache sync adds the cycle value from the new entry to the SelectItem list. This is done without any OptionDataSource fetch so my select distinct is not used and this gives me duplicates in the SelectItem list. (They are also not sorted.)

I tried using a DataArrived handler on the SelectItem. My intent was to issue a new fetch for the SelectItem when the cache sync changed the list, but the handler wasn't called due to the cache sync.

How should I fix this? Do I watch for data updates and refetch? If so, what handler do I use and on what object? Are there some settings which I need to use that I've missed?

Am I on the right track or is there some other way to construct a distinct list for the SelectItem that will be updated without generating these duplicates?

Thanks,
Kevin

Database security?

$
0
0
Smartclient's reference manual page about the server.properties file only describes how to access the database server with a single username/password. Is there a way to allow multiple database users logged in through a Smartclient GUI component? What about authenticating database access in Smartclient GUI objects with an SSL key? i.e., how can I implement this:

http://www.postgresql.org/docs/9.3/static/auth-methods.html#AUTH-CERT

ButtonClickEvent.getButton(ButtonClickEvent.java) doesn't return a Button

$
0
0
sgwt: 4.1p.0.0
sc: v9.1p_2014-03-06
ff:26.0
Code:

@Override
public void onModuleLoad() {
        new Dialog(){{
                setButtons(Dialog.YES, Dialog.NO, Dialog.CANCEL);
                addButtonClickHandler(new ButtonClickHandler() {
                        @Override
                        public void onButtonClick(ButtonClickEvent event) {
                                Button button = event.getButton();
                        }
                });
        }}.show();
}

Code:

Caused by: java.lang.ClassCastException: com.smartgwt.client.widgets.IButton cannot be cast to com.smartgwt.client.widgets.Button
    at com.smartgwt.client.widgets.events.ButtonClickEvent.getButton(ButtonClickEvent.java)

Page.setUnloadMessage

$
0
0
Hi,

I just wanted to point out, that Page.setUnloadMessage(message) is not included in docs, but may be quite useful for some of us.

Kind regards
Viewing all 4756 articles
Browse latest View live