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

DrawLabel/DrawRect/DrawOval

$
0
0
ROTATE TO/ROTATE BY for this components it is working only on an event....? or I can just create a new label and apply rotateTo(30);
Thank you

How to detect new or midified record in listgrid

$
0
0
I have a problem about listgrid edit.I want to add or modify many record in a listgrid.But when I finish all of my edit,I can not detect which row is added or modified? I need help to resolve this problem.Anyone can help me?Thanks

ListGrid opened group empty & SummaryRow css class

$
0
0
Hi,

http://www.smartclient.com/smartgwt/showcase/#grid_summaries_featured_category

Choose any row and modify its category.
A new group appears opened but empty.
Closing the group and reopening it change nothing, the group is still empty.

And why do the summary row has a listGrid css class ? Is there any way to change this class ?

Tested on Chrome 31 & FF 26

Thank you

Progress Bar Component inside ListGrid Cell

$
0
0
Is it possible for Smartclient to achieve the attached ListGrid? We want to embed a progress bar component inside grid cell.

I went through SmartClient examples and I did not find any example looks like a progress bar component. I wonder if you can give me any suggestion on how to achieve this using SmartClient.

Thanks

Attached Images
File Type: png demo.PNG (10.7 KB)

Enhancement(?):ListGridField.setFilterEditorValueM ap behavior

$
0
0
Hi Isomorphic,

what do you think of the following enhancement?
Right now, if I use the following code for a ListGridField, the result is a dropdown with 5 lines (1x no filter, 3x "not ready", 1x "ready").

Code:

HashMap<String, String> vM = new HashMap<String, String>();
vM.put("missingBoth", "not ready");
vM.put("missingAddress", "not ready");
vM.put("missingCategory", "not ready");
vM.put("finished", "ready");
public final class myListGridField.setFilterEditorValueMap(vM);

I think it would be better to have instead 3 lines (1x no filter, 1x "not ready", 1x "ready"), where "not ready" results in an OR-AdvancedCriteria with 3 sub-Criteria.

Do you think this enhancement is a good idea? Is it currently possible to archive this behaviour in some other way?

Best regards,
Blama

Selenium RemoteWebDriver in SmartGWT

$
0
0
Hello!

I've been evaluating the integration of selenium 2 and SmartGWT before deciding to migrate to SmartGWT plattform, and I successfully did a PoC using SmartClientFirefoxDriver. However, I haven't been able to find any references to the RemoteWebDriver selenium class equivalent in SmartGWT library. Is there no way to do remote testing using Selenium and SmartGWT, or does Isomorphic provide a way to do remote testing with selenium and SmartGWT? Which class should be used to do so?

I am using SmartClient_v90p_2014-01-13 Evaluation version

Greetings

Vertical Lines on a Line chart

$
0
0
Hi,

Just a quick question.
Is it possible to display vertical lines or show the tick marks on the X axis on a line chart?

I have only seen vertical lines on scatter charts.

We are currently testing with SmartGWT 4.1.

Thanks,

Frederic

Bug using ComboBoxItem with DataSource in ListGrids

$
0
0
Hi there,
we are using the latest build of smartclient 9.0 and we have a kind of an issue. It seems by using comboBoxItems with datasources in a listgrid there are some errors in the displayed field values.

To reproduce you can follow this link:
http://www.smartclient.com/docs/9.0/a/system/reference/SmartClient_Explorer.html?#customEditors
here you have to copy this source into the js-editor
Code:

isc.ListGrid.create({
    ID: "countryList",
    width:820, height:224, alternateRecordStyles:true,
    cellHeight:42, wrapCells:true,
    dataSource: countryDS,
    fields:[
        {name:"countryName", width:100},
        {name:"government", width:175,
            editorType:"textArea",
            editorProperties:{height:40}
        },
        {name:"population", width:100, formatCellValue:"isc.NumberUtil.toUSString(value)",
            editorType:"spinner"
        },
        {name:"independence", width:225,
            editorProperties:{useTextField:false}
        },
        {
            "name":"capital",
            "editorType":"ComboBoxItem",
            "valueField":"pk",
            "editorProperties": {
                "autoFetchData":true,
                "fetchDelay":500,
                "displayField":"capital",
                "pickListWidth":"300",
                "optionDataSource": countryDS,
                "filterFields": [ "countryCode"],
                "pickListFields": [{
                      "name":"pk",
                      "title":"Number",
                      "type":"text"
                  }, {
                      "name":"countryCode",
                      "title":"Code",
                      "type":"text"
                  }, {
                      "name":"capital",
                      "title":"Capital",
                      "type":"text",
                      "showIf": function() { return false }
                  }
                ],
                "pickListProperties": {
                    "showFilterEditor":true
                }
            }
        },
    ],
    autoFetchData: true,
    canEdit: true,
    editEvent: "click"
})

After switching the tab to the html view you can now edit the last column (capitals). By selecting another capital from the picklist and click in another row (or press enter) the capital removes itself and the valueField /primary key appears.
This seems to be like a bug in smartclient. Is this a known bug or is there a kind of workaround?

Best Regards

How to reset default properties?

$
0
0
SmartClient Version: v8.3p_2013-06-19/PowerEdition Deployment (built 2013-06-19)

In our application, the user can set the day of the week for the application (and the date chooser). When they do this, we execute code like this:

Code:

DateChooser chooser = new DateChooser();
chooser.setFirstDayOfWeek( value );
DateChooser.setDefaultProperties( chooser );

Which works fine. The problem comes if they change it again and we again call setDefaultProperties, the change does not take effect.

I expect this is because the underlying code calls $wnd.isc.DateChooser.addProperties(properties);, which doesn't sound like it overrides any existing default properties.

Is there a way that default properties can be reset or overridden?

Thanks!

Importing CSV into a listgrid

$
0
0
Hi all,

I download data from a listgrid into a csv file with exportData.
Very simple and very effective. Except that is putting in the file the listgridfield titles and not the names. The titles have a <span> with CSS style to make some of them bold. How do I put the names instead?

Code:

    private void downloadCsv() {
        DSRequest dsRequestProperties = new DSRequest();
        dsRequestProperties.setExportAs(ExportFormat.CSV);
        dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
        List<String> gridFields = MainPanel.getGrid().getFieldsNames();
        dsRequestProperties.setExportFields(gridFields.toArray(new String[0]));
        MainPanel.getGrid().exportData(dsRequestProperties);
    }

Now the bigger question:

After the user makes some modifications in the csv file in Excel (I'm using CSV since XLS uploading is not yet supported), I'd like to reimport the data into the grid by uploading the same file. I do not need the user to review the changes in an additional grid after the validation as in the BatchUploader sample.

I would like to make following:
- let the user upload a csv file, verifying the file extension (probably client side?)
- get the data from the file and, for the records where primary key and fields match, update the data in the grid. I was thinking sending the file to a servlet with a FileItem in a dynamic form, parse it into Pojos, send back to the client the data in any data structure and programmatically doing the match client side
- At the callback, prompt the user with a confirmation window with a summary of how many records are going to be updated, and at user confirmation, save the changes reusing my saving mechanism (the editing is not with datasource save, it's done in a dynamic form editor that bulk saves the changes sending data to the backend by RPC and refetches the grid at callback).

The grid has a dynamic datasource. In the BatchUploader sample the records are added to the grid. Mine is an update of records. Also, it's using a Hibernate datasource while I have a dynamic datasource. In the same example, I can't find the servlet that handles the request (specifically, the exampleTransactionManagerController).

Can you please indicate the simpler way to do what I need with some example code?
Is it possible to use a FileItem in a dynamic form to send the uloaded file to a servlet, parse the data into Pojos, and send them back to the client for validation and processing like I want to do?

Thanks,
Vittorio

=========== ENVIRONMENT DETAILS ===========

smartgwt.version:4.1.d20130712
SmartClient Version: SNAPSHOT_v9.1d_2013-07-12/PowerEdition Deployment (built 2013-07-12)

Firefox 25.0

Enhancement: New example in Client showcase, showing the use of CriteriaEditing

$
0
0
Hi Isomorphic,

I'm stuck a bit at CriteriaEditing (http://www.smartclient.com/smartgwte...iaEditing.html). What I want to do is a simple use case:
1) ListGrid with 3 String columns
2) Filter on all columns, 1st is SelectItem (see below), 2nd&3rd Textbox (iEquals)
3) The SelectItem aggregates (startingletter a...f, g...z) (effectively requiring an OR-AdvancedCriteria)
4) Filter should work on single columns and if filtering on many columns.

The solution should require the use of
setCanEditCriterionPredicate(new FormItemCanEditCriterionPredicate() {...};
setCriterionSetter(new FormItemCriterionSetter() {...};
setCriterionGetter(new FormItemCriterionGetter() {...};
as there is no example to far and the forums give not enough results for me to get my example working (I get to many calls to the registered functions with parameters that don't make sense for me).

Thank you & best regards,
Blama

Listgrid json format

$
0
0
Hi.
SmartClient Version: v9.0_2013-07-03/LGPL Development Only (built 2013-07-03), both ff and chrome

I cannot get ListGrid working with the json format described here:
http://www.smartclient.com/smartgwt/...ataSource.html

Code:

public class SGwtUI implements EntryPoint {
    public void onModuleLoad() {
        VLayout main = new VLayout();
        ListGrid worklistGrid = new ListGrid();
        worklistGrid.setDataSource(WorklistDataSource.getInstance());
        worklistGrid.setAutoFetchData(true);

        main.addMember(worklistGrid);
        main.draw();
    }
}

Code:

public class WorklistDataSource extends RestDataSource {

    public static final String ID = "worklistDS";
    private static final WorklistDataSource INSTANCE = new WorklistDataSource();

    public static WorklistDataSource getInstance() {
        return INSTANCE;
    }
   
    private WorklistDataSource() {
        setID(ID);
        setClientOnly(false);
        setFields(generateFields());
        setOperationBindings(generateOperationBindings());
    }

    private OperationBinding[] generateOperationBindings() {
        List<OperationBinding> operationBindings = new ArrayList<OperationBinding>();

        OperationBinding fetchOB = new OperationBinding(DSOperationType.FETCH, "servlet");
        fetchOB.setDataProtocol(DSProtocol.POSTPARAMS);
        fetchOB.setDataFormat(DSDataFormat.JSON);
        operationBindings.add(fetchOB);

        return operationBindings.toArray(new OperationBinding[operationBindings.size()]);
    }

    private DataSourceField[] generateFields() {

        List<DataSourceField> dsFields = new ArrayList<DataSourceField>();

        DataSourceField idField = new DataSourceIntegerField("id");
        idField.setPrimaryKey(true);
        dsFields.add(idField);

        DataSourceField typeField = new DataSourceTextField("code", "Type");
        dsFields.add(typeField);

        DataSourceField startField = new DataSourceDateField("started", "Started");
        dsFields.add(startField);
        return dsFields.toArray(new DataSourceField[dsFields.size()]);
    }

}

When the server response is:
Code:

{
"response":{
  "status":0,
  "startRow":0,
  "endRow":1,
  "totalRows":2,
  "data":[
    {"id":768,"code":"d","started":"2013-11-20T14:34:39Z"},
    {"id":1242,"code":"p","started":"2013-11-20T14:34:45Z"}
  ]}
}

I get three empty rows with no error in dev console.

But with
Code:

{
"response":{
  "status":0,
  "startRow":0,
  "endRow":1,
  "totalRows":2,
  "data":{
    "WHATISTHIS":[
      {"id":768,"code":"d","started":"2013-11-20T14:34:39Z"},
      {"id":1242,"code":"p","started":"2013-11-20T14:34:45Z"}
    ]}
  }
}

it shows correct two rows.

Has the format changed or do you have any idea what is causing this?
Thanks

ClassCastException on ListGrid.find (AdvancedCriterion)

$
0
0
Hello,

I am using Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v9.1d_2014-01-14/Pro Deployment 2014-01-14).

I want to find a record in an array of ListGrids.
I prepared an AdvancedCriterion:
Code:

final PickerIcon searchPicker = new PickerIcon (PickerIcon.SEARCH, new FormItemClickHandler () {
  public void onFormItemClick (final FormItemIconClickEvent event) {
      final String s = event.getItem ().getValue ().toString ();
      final Criterion searchExaminer = new Criterion ("prueferNamen", OperatorId.STARTS_WITH, s);
      final Criterion searchExam = new Criterion ("titel", OperatorId.CONTAINS, s);
      final AdvancedCriteria examSearchCrit = new AdvancedCriteria (OperatorId.OR, new Criterion[] { searchExaminer, searchExam });
      for (final ListGrid l : examLists) {
        int idx = l.findIndex (examSearchCrit);
        Record r = l.find (examSearchCrit);
        ...

While the method findIndex is executed, the execution of find throws a class cast exception:
Code:

Caused by: java.lang.ClassCastException: Cannot cast com.smartgwt.client.data.AdvancedCriteria to com.google.gwt.core.client.JavaScriptObject
    at java.lang.Class.cast(Unknown Source)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:163)
    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.widgets.grid.ListGrid.find(ListGrid.java)

Where's my mistake?
Andreas

DrawRect in VLayout setTop NOT WORKING OK - PLEASE HELP

$
0
0
version: smargwt 4.0, latest nightly build -dev

I'm having the following situation:
VLayout
- VLayout
- tabs
- VLayout
- VLayout
- DrawPane
- DrawRect
- DrawOval
- Canvas
- DrawLabel
All the components from the DRawPane have X and Y set with setTop and SetLeft. For DrawRect and DrawPane, setTop and setLeft is not RELATIVE to DrawPane but to the first VLayout. This is not what I need. Can someone tell me if this is true or am I doing something wrong.

How to draw a horizontal line in SmartGWT

$
0
0
How to draw a horizontal line (<hr>) in SmartGWT?

How to disable one of the SectionStackSections in SectionSection

$
0
0
We have a few SectionStackSections in SectionSection. If we want to disable (not hide) one of the SectionStackSection, what should we do?

ListGrid.getResultSet().getResultSize() causes exception.

$
0
0
I am using SmartGWT 4.1-d20131117.

I am attempting to refresh a ListGrid by following the recommended code at https://isomorphic.atlassian.net/wiki/pages/viewpage.action?pageId=524941.

Here is the code from the Isomorphic Wiki page:

Code:

private void onRefresh() {
    DataSource dataSource = listGrid.getDataSource();
    Criteria criteria = listGrid.getCriteria();
 
    Integer[] visibleRows = listGrid.getVisibleRows();
    Integer startRow = 0;
    Integer endRow = (visibleRows[1] + listGrid.getResultSet().getResultSize());
 
    DSRequest request = new DSRequest();
    request.setStartRow(startRow);
    request.setEndRow(endRow);
    request.setSortBy(listGrid.getSort());
 
    dataSource.fetchData(criteria, new DSCallback() {
        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            DataSource dataSource = listGrid.getDataSource();
 
            ResultSet resultSet = new ResultSet(dataSource);
            resultSet.setInitialLength(response.getTotalRows());
            resultSet.setInitialData(response.getData());
            resultSet.setInitialSort(listGrid.getSort());
            resultSet.setCriteria(listgrid.getCriteria());
 
            listGrid.setData(resultSet);
        }
 
    }, request);
}

This code fails with an exception on the line containing listGrid.getResultSet().getResultSize()

Here is the stack trace

Code:

com.google.gwt.dev.shell.HostedModeException: invoke arguments: JS value of type JavaScript object(8659), expected int
    at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
    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.getAttributeAsInt(BaseClass.java)
    at com.smartgwt.client.data.ResultSet.getResultSize(ResultSet.java:310)
    at com.cedarcone.Orchestrate.client.viewer.tabset.classifier.StatusListGrid.refreshDisplay(StatusListGrid.java:182)
    at com.cedarcone.Orchestrate.client.viewer.tabset.classifier.StatusListGrid.access$1(StatusListGrid.java:180)
    at com.cedarcone.Orchestrate.client.viewer.tabset.classifier.StatusListGrid$2.run(StatusListGrid.java:65)
    at com.google.gwt.user.client.Timer.fire(Timer.java:149)
    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:601)
    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:27

If I remove all the code except "getResultSet().getResultSize();" I get the same failure/exception.

RowMouseDownEvent and shift key

$
0
0
Hi,

in RowMouseDownEvent I can find:

isCtrlKeyDown()
isAltKeyDown()

but nothing regarding the SHIFT key... Would it be possible to add this one as well ?

Thx

(We are currently using SmartGWT 4.0p)

SelectItem with .ds.xml JPA DataSource

$
0
0
SmartClient Version: v9.0p_2013-11-15/Pro Deployment (built 2013-11-15)
Google Chrome: Version 31.0.1650.63 m

Hello,

I've got questions regarding SelectItems and the binding of a JPA DataSource defined in a .ds.xml format.

First of all to keep this simple, here's an example:

Entities: Company, Person


Company
--------
id (Long)
name (string)
owner (Person)

Person
-------
id (Long)
firstName (String)
lastName (String)
employer (Company)


Now the first thing would be in the Form for the company, I'd want a SelectItem with all the persons. So I'd define this in the company.ds.xml:

Code:

<field name="ownerName" hidden="true" includeFrom="Person.name"/>
<field name="owner" displayField="ownerName" editorType="ComboBoxItem" foreignKey="Person.id"/>


In the CompanyForm.java I'd have something like this:
Code:

SelectItem owner = new SelectItem("owner");
owner.setSortField("lastname")


Now first of all, the Persons aren't sorted. They are ordered by Id. Did I use the SortField wrong?

Second issue would be that I'd want both firstname and lastname in the SelectItem displayed, as well as for the sorting. Would I have to use a DMI to concatenate these attributes?



Now to extend on this example, I'd also want to show the employer of the company's owner in the CompanyForm. How would I accomplish this result?
I've tried something like this in the company.ds.xml:

Code:

<field name="employer" includeFrom="Person.employer.name"/>


But I get a NullPointerException, what would be the right approach?

isc.logWarn("java.lang.NullPointerException\r\n\ta t
com.isomorphic.datasource.PoolableDataSourceFactor y.makeUnpooledObject(PoolableDataSourceFactory.jav a:130)\r\n\tat
com.isomorphic.datasource.PoolableDataSourceFactor y.makeObject(PoolableDataSourceFactory.java:138)\r \n\tat
org.apache.commons.pool.impl.GenericKeyedObjectPoo l.borrowObject(GenericKeyedObjectPool.java:1179)\r \n\tat
com.isomorphic.pool.PoolManager.borrowObject(PoolM anager.java:84)\r\n\tat
com.isomorphic.datasource.DataSourceManager.getDat aSource(DataSourceManager.java:95)\r\n\tat
com.isomorphic.datasource.DataSourceManager.getDat aSource(DataSourceManager.java:86)\r\n\tat
com.isomorphic.datasource.DataSourceManager.get(Da taSourceManager.java:118)\r\n\tat
...



Hope to get this sorted and thanks for any help in advance.

DynamicScreenGenerator.getScreen() - add HttpServletRequest parameter

$
0
0
The latest Version 9.1 PRO has the new feature
ScreenLoaderServlet.addDynamicScreenGenerator() to register a custom screen loader implementing interface DynamicScreenGenerator.

This is great!

The interface for the screen loader DynamicScreenGenerator.getScreen(String viewName) currently only supports the screen name as input parameter, so the custom loader class knows what screen to load by screen name.

In some cases, this can be too limited.
Think of tenant or user specific screens.

Wish:
Add the HttpServletRequest as input parameter to the method.
DynamicScreenGenerator.getScreen(String viewName, HttpServletRequest request)

This way, further parameters used in the screen look up can be feed in via the request or taken from the users session.

Technically it shouldn't be too complicated, as the ScreenLoaderServlet is a servlet and can pass the HttpServletRequest further to the getScreen method.

Thank you,
Best regards,
Daniel
Viewing all 4756 articles
Browse latest View live