Quantcast
Viewing all 4756 articles
Browse latest View live

Load listgrid from xml file

Hi all,

I'm using smartgwt 4.0p.

I'm facing the following issue:

I'm trying to load a listgrid from an xml file. When running the code in my eclipse environnement in development mode, all works fine. But when the application is deployed in jboss on unix machine, i get an HTTP 404 error "imports/xml/warrantyData.xml" (see attached file for details)
Code:

DataSource dataSource = new DataSource();
                        dataSource.setInheritsFrom(schemaDS);
                        dataSource.setUseParentFieldOrder(true);
                        dataSource.setDataFormat(DSDataFormat.XML);
                        dataSource.setRecordXPath("//coWarranty");
                        dataSource.setDataURL("imports/xml/warrantyData.xml");

                        DataSourceTextField itemID = new DataSourceTextField("id");
                        itemID.setHidden(true);
                        itemID.setPrimaryKey(true);

                        listGrid.setDataSource(dataSource);
                        listGrid.fetchData();

Any hint about this?

Thanks in advance

Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
bug_import.png (14.1 KB)

how can i use the operator 'contains' (~) without using the advancedcriteria

Hello,
I have to check to customize the style of my ListGrid and I have to check if CH1 (string) contains CH2 (string).
Could you tell me how to do it ?
thank you in advance

CubeGrid example source code link broken

Hi Isomorphic,

I consider to buy a license of your Pro+Analytics modules but first I want to get a working example of integration Mondrian and CubeGrid. I found this nice article: http://blog.isomorphic.com/connecting-the-cubegrid-with-pentaho-mondrian-jasperreports-and-microsoft-analysis-services/ but seems that the link to source code is not accessible. Is it because I haven't bought the license?

Thanks

DateItem/DateTimeItem.setUseMask(..) bug

SmartGWT 4.0Pro 02/21/2014 build.

Subsequent calls to DateItem/DateTimeItem.setUseMask(true) causes the field height to increase to height of (textfield + label) when Label orientation is set to TOP. See attached image.

Reason why I am calling setUseMask more than once is to update the mask, after changing locale and setting new date formats in DateUtil.

The following may be the offending code in ISC_Forms.js
Code:

            // If we have a specified height, expand the text box to fill the available space

            if (this.height && (!this.textFieldProperties || !this.textFieldProperties.height))
            {
                textField.height = this.getInnerHeight();
            }


Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
DateItemSetUseMaskBug.png (4.3 KB)

Enable Drag on Treegrid which is an expansion component

We are currently using smartgwt lgpl
version 4.0-10-28-2013 and are using only Firefox version 10.x for our application.

We are building out a widget to meet a requirement in our application wherein the widget is containes


ListGrid (with a RecordComponent)
+ TreeGrid1 (with a RecordComponent and is an expansion component of the ListGrid)
+ TreeGrid2 (which is an expansion component of TreeGrid1).

The requirement is that we have to enable dragging records from TreeGrid2 onto the nodes / leaves on TreeGrid1 .

We are setting all the following options on all the grids

setSelectionType(SelectionStyle.SINGLE)
setCanDrag(Boolean.TRUE);
setCanReorderRecords(Boolean.TRUE);
setCanDragRecordsOut(Boolean.TRUE);
setCanRemoveRecords(true); setDragAppearance(DragAppearance.OUTLINE);
setDragTrackerMode(DragTrackerMode.RECORD);

but we just can't drag records out of a treegrid which is an expansion component of another TreeGrid which in turn is an expansion component of a listgrid as explained above ?


The basic question is that is it possible to enable dragging from an expansion component of an expansion component ?

Any help would be highly appreciated.

EventHoverHTMLEvent - GWT Compiler Warning - Referencing deprecated class

hi isomorphic,

i get this gwt compiler warning
Code:

Warnings in 'jar:file:/..../smartgwtpower-4.1p/lib/smartgwtpower.jar!/com/smartgwt/client/widgets/calendar/Calendar.java'
Referencing deprecated class 'com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent'

with every build. As you can see -in the ant task javac- I just use the deprecated method Page.RegisterKey and not the class EventHoverHTMLEvent. In my application I use the class EventHoverHTMLEvent never directly.

Code:

Buildfile: C:\Projects\.eclipse372\xxxpay\build.xml
clean:
  [delete] Deleting directory C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
  [delete] Deleting directory C:\Projects\.eclipse372\xxxpay\gwt-unitCache
libs:
javac:
    [mkdir] Created dir: C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
    [javac] C:\Projects\.eclipse372\xxxpay\build.xml:66: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 112 source files to C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
    [javac] C:\Projects\.eclipse372\xxxpay\src\com\xxxpay\client\MainEntryPoint.java:106: warning: [deprecation] registerKey(com.smartgwt.client.core.KeyIdentifier,com.smartgwt.client.util.KeyCallback) in com.smartgwt.client.util.Page has been deprecated
    [javac]                        Page.registerKey(debugKey, new KeyCallback() {
    [javac]                            ^
    [javac] C:\Projects\.eclipse372\xxxpay\src\com\xxxpay\client\test\BuiltInDS.java:66: warning: [deprecation] registerKey(com.smartgwt.client.core.KeyIdentifier,com.smartgwt.client.util.KeyCallback) in com.smartgwt.client.util.Page has been deprecated
    [javac]                Page.registerKey(debugKey, new KeyCallback() {
    [javac]                    ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 2 warnings
    [copy] Copying 155 files to C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
gwtc:
    [java] Compiling module com.xxxpay.xxxpay
    [java]    Validating units:
    [java]      [WARN] Warnings in 'jar:file:/C:/Projects/.eclipse372/xxxpay/3rdparty/isomporphic/smartgwtpower-4.1p/lib/smartgwtpower.jar!/com/smartgwt/client/widgets/calendar/Calendar.java'
    [java]          [WARN] Line 3298: Referencing deprecated class 'com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent'
    [java]    Compiling 6 permutations
    [java]      Compiling permutation 0...
    [java]      Compiling permutation 1...
    [java]      Compiling permutation 2...
    [java]      Compiling permutation 3...
    [java]      Compiling permutation 4...
    [java]      Compiling permutation 5...
    [java]    Compile of permutations succeeded
    [java] Linking into C:\Projects\.eclipse372\xxxpay\war\xxxpay
    [java]    Link succeeded
    [java]    Compilation succeeded -- 142,246s
build:
BUILD SUCCESSFUL
Total time: 2 minutes 37 seconds

This is just an information to you. I have no problem with that.

i used: Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-03-11/PowerEdition Deployment 2014-03-11)

Best regards,
Mirko

IllegalStateException - Cannot change configuration property 'visibility' to hidden

hi isomorphic,

after upgrading from 4.1p_20140304 to 4.1p_20140311 i can't change the visibility of DynamicForm. i get this IllegalStateException.

Code:

Caused by: java.lang.IllegalStateException: Cannot change configuration property 'visibility' to hidden now that component isc_DynamicForm_0 has been created.
at com.smartgwt.client.widgets.BaseWidget.error(BaseWidget.java:728)
at com.smartgwt.client.widgets.BaseWidget.error(BaseWidget.java:716)
at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:740)
at com.smartgwt.client.widgets.Canvas.setVisibility(Canvas.java:4859)
at com.smartgwt.client.widgets.Canvas.setVisible(Canvas.java:8537)
at com.smartgwt.sample.client.BuiltInDS.onModuleLoad(BuiltInDS.java:181)

For troubleshooting demonstration I have the following line added to the sample.
Code:

boundForm.setVisible(false);
Code:

package com.smartgwt.sample.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.SortArrow;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
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.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VStack;
import com.smartgwt.client.widgets.viewer.DetailViewer;

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

        /**
        * This is the entry point method.
        */
        @Override
        public void onModuleLoad() {
                KeyIdentifier debugKey = new KeyIdentifier();
                debugKey.setCtrlKey(true);
                debugKey.setKeyName("D");

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


                ListGrid grid = new ListGrid();
                grid.setLeft(20);
                grid.setTop(75);
                grid.setWidth(130);
                grid.setLeaveScrollbarGap(false);
                grid.setShowSortArrow(SortArrow.NONE);
                grid.setCanSort(false);
                grid.setFields(new ListGridField("dsTitle", "Select a DataSource"));
                grid.setData(new ListGridRecord[]{
                                new DSRecord("Animals", "animals"),
                                new DSRecord("Office Supplies", "supplyItem"),
                                new DSRecord("Employees", "employees")}
                                );
                grid.setSelectionType(SelectionStyle.SINGLE);
                grid.addRecordClickHandler(new RecordClickHandler() {
                        @Override
                        public void onRecordClick(RecordClickEvent event) {
                                DSRecord record = (DSRecord) event.getRecord();
                                bindComponents(record.getDsName());
                        }
                });

                grid.draw();

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

                Label label = new Label();
                label.setContents("<ul>" +
                                "<li>select a datasource from the list at left to bind to these components</li>" +
                                "<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);

                boundList = new ListGrid();
                boundList.setHeight(200);
                boundList.setCanEdit(true);

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

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

                HLayout hLayout = new HLayout(10);
                hLayout.setMembersMargin(10);
                hLayout.setHeight(22);

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

                newBtn = new IButton("New");
                newBtn.addClickHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
                                boundForm.editNewRecord();
                                saveBtn.enable();
                        }
                });
                hLayout.addMember(newBtn);

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

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

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

                vStack.addMember(hLayout);

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

                vStack.draw();

                // java.lang.IllegalStateException
                if (0==0) {
                        boundForm.setVisible(false);
                }

        }

        private void bindComponents(String dsName) {
                DataSource ds = DataSource.get(dsName);
                boundList.setDataSource(ds);
                boundViewer.setDataSource(ds);
                boundForm.setDataSource(ds);
                boundList.fetchData();
                newBtn.enable();
                saveBtn.disable();
        }
}

best regards,
mirko

i used: Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-03-11/PowerEdition Deployment 2014-03-11)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0'

Dateitem.endDate value is too close to current date

As we can see in the documentation, the default value for endDate is currently 12/31/2015 and that is too close to the current day. I would like to suggest that it changes to something further in the future (ex: 12/31/2020 or later).

http://www.smartclient.com/docs/9.1/a/b/c/go.html#attr..DateItem.endDate

Form's saveData not passing uploaded file to the server after an error

SmartClient Version: v9.0p_2013-11-03/PowerEdition
Browsers: Chrome 33, safari 5.1.7

We are seeing this issue on chorme and safari browsers. IE works fine.

We have a dynamic form with multiple text fields and one field to upload csv files as follows.

{
name: "file",
required: true,
width: 250,
type: "binary",
colSpan: 3
}

We throw parsing Exception in the server, if the uploaded file is not a csv file and set status as 100 and return a message.

In the saveData call back we look for the status code and display the error message as shown below. Once we close the message window, we clear the values and the empty form is displayed.

this.form.saveData(
function(dsResponse, data, dsRequest) {
if(dsResponse.status==100||dsResponse.status==-4){
isc.say(data); windowRef.uploadDynamicForm.clearValues();
}else { //we display a grid.}
}
, {
params: {

}
});


Now if we try to upload the correct csv file and submit, all the values except the file data is available in the server.

As you see, the way we are handling the error in the form is by catching an exception on the server

catch (ParseException e) {
log.error("Issue with uploading file", e);
dsResponse.setData(ERROR_MSG);
dsResponse.setStatus(100);
}
By doing this are we missing anything (clearing out any values) which is causing the file not to be uploaded to the server in subsequent submissions.

Issues noted:

1) If there is any exception thrown, in the subsequent submissions the file Data is not being sent to the server.

ListGrid with preloaded checkboxes

SmartClient Version: v8.3p_2013-02-02/LGPL
gwt 2.3

I have a ListGrid with state loaded from the database, I used:
Code:

newListGrid.setSelectionType(SelectionStyle.SIMPLE);
newListGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);

Users select or deselect one or more checkboxes and save their changes.
I tried SelectionUpdatedHandler, but I don't see a way to access records that have changed - only records that are selected and I need both.
I tried a SelectionChangedHandler, it allows me to collect only the records that are changed, but it fires twice and resets the record back to its original state (I can't just collect the records and flip the state - it won't catch a checkbox clicked multiple times).

Code:

class FilterSelectionChangedHandler implements SelectionChangedHandler {

      ...
          AlertFilterListGridRecord aflgr = (AlertFilterListGridRecord)event.getRecord();
          aflgr.setAttribute(CHECK_VALUE, event.getState());
            editedRecords.add(aflgr);
        }
    }

I saw a thread with a reply about using mouse up - but I've been using gwt/smartGWT for a couple of weeks and can't figure out how that's supposed to work, do I nest a mouse up handler in the SelectionChangedHandler?

Failing that, is there any other way to get the checkbox state? Right now I'm using ListGrid.getSelected, then removing selected and whatever's left isn't selected, but there has got to be a better way.

Thanks in advance

KeyPress filter and French keyboard

Hello,

I use in an application a KeyPress filter to restrict the authorized characters for a TextItem. The filter is a simple regex specifying the characters that are allowed:
textItem.setKeyPressFilter("[a-zA-Z0-9/\\-?:().,\"+ ]");

The filter works well with English keyboards but not with French keyboards. With a French keyboard all characters coming from the combination of Alt Gr + another key are not filtered. For instance, '@' is not filtered as it should. This problem occurs with Firefox 3.6 as well as IE8 which are the browsers that my application must support.

I tried to define in my Index.gwt.xml file several configurations by adding/combining the locales 'fr', fr_Fr', ... but none of them worked.

Did I miss something?

Thank you.

Configuration:
SmartGWT 3.0
Firefox 3.6, Internet Explorer 8

ServerObject Custom Validators

Hello All,

Regarding the ServerObject Custom Validators,

I have simple ListGrid with some custom validators in the datasource XML file, I noticed that the condition method in the validator class was called many times while I am editing the grid even if am not changing the values of any field in the grid.

Based on the example of the attached files, if the value of the warehouse field is empty in the grid then after editing that row the condition method of the validator class is getting called 3 times (one time for the each of the following fields II0_DOC_HEADER, II0_DOC_DESCRIPTION, II0_ISSUE_DEPARTMENT) though these fields were not touched in the grid.

My understanding that the validator describes a check that should be performed on a value the user is trying to save, but in my case I can see many validation are going on even if there are no save operations

Waiting your feedback

Version : SmartClient_v90p_2014-03-07_PowerEdition

Attached Files
Image may be NSFW.
Clik here to view.
File Type: xml
CUSTODY_RETURN_MAIN.ds.xml (1.8 KB)
Image may be NSFW.
Clik here to view.
File Type: java
CustodyReturnMainValidatorDMI.java (1.3 KB)
Image may be NSFW.
Clik here to view.
File Type: txt
depug.txt (2.8 KB)
Image may be NSFW.
Clik here to view.
File Type: jsp
Item.jsp (934 Bytes)

Grouping in Grid is not working for records if there are many

I have written a list grid which is retrieving data from a data source and I have done a group on a column in the list grid of smart client using the attribute

groupByField: 'RQ0_STATUS'


Now if the data source has fetched only few records then the group is happening properly. If its fetching more records the grouping the not properly happening.

I have attached the list grid jsp code and the screen shots of our screen to give you an idea.

Hope you would reply ASAP.
Awaiting your feedback.

Version : SmartClient_v90p_2014-03-07_PowerEdition

Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
group.png (41.0 KB)
Image may be NSFW.
Clik here to view.
File Type: png
group_issue.png (58.6 KB)
Attached Files
Image may be NSFW.
Clik here to view.
File Type: txt
jsp_file.txt (1.9 KB)

Import of CSV for European countries

Hi,

We are using SmartClient version : v9.0p_2013-09-22/PowerEdition Deployment (built 2013-09-22)

We are having a functionality where we are giving an option to download large CSVs containing numbers. This functionality is being used across the world.

Here, we are facing issues with the users of European countries where decimal and comma is used interchangeably and our downloaded CSV for European countries make all the data in one column and more confusing to end users.

Request you to please help us in getting this issue resolved so that our downloaded CSV can be usable for every users.

Let me know, if you need more input.

Thanks a lot

Field memory in TextItem

Hi Isomorphic

While i type any value in a Textitem,all previously entered data will be visible in a list of options via a drop-down Pick-list .
The set of options will be filtered based on the current value in the text field

Actually i saved the data in field memory
Is it possible to do in smartgwt ?

I am using
SmartClient Version: v8.3_2012-11-20/PowerEdition Deployment (built 2012-11-20)

FireFox-25.0.1
Chrome 33.0.1750.146
IE 9

Browser Compatibility

Hi there.

I developed an application for a client in the past using SmartGWT.

Currently, there are several issues with browser compatibility (specifically IE) that need to now get rectified for a separate deployment (client).

Is there a case where it would be possible to switch from SmartGWT to SmartClient IF more direct access to the javascript is required to resolve some of these issues?

OR, are all browser compatibility issues able to be resolved in the SmartGWT environment?

Thanks in advance!

Richard

Custom DataSource and EJB DI

Hello,
I tried to use EJB DI in Custom DataSource. It failed. I got null instance.
Code:

public class UsersDS extends BasicDataSource {
@Inject
public IManagementService managmentService;

@Override
public DSResponse executeFetch(DSRequest req) throws Exception {
...
List<Obj> objs= managmentService.getObjs(...);
...
}

managmentService is null. Can you prompt how can I use DI in Custom DataSource? I really need it. It works with servlets. I deploy it on Wildfly 8.0.

Wrong description content in EventWindow

Hello,

when creating an event with no description, the event is shown with the discription of an other event.

You can reproduce it in the Databound Calender example in the showcase.

Add a new event without a description at Friday 05:00am by clicking in the calendar background.

Resize the event by Drag&Drop. The events shows the description of the event at Friday 11:am.

(See attached screen shot)

We are using SmartClient/SmartGWT Framework (v9.1p_2014-03-11/Pro Deployment 2014-03-11)

Regards

Peter

Attached Images
Image may be NSFW.
Clik here to view.
File Type: jpg
WrongDescription.jpg (44.3 KB)

Hover on title part of EventWindows

Hello,

in SmartGWT 3.1 hover on an event window opens on the title and the description part.

Now, in SmartGWT 4.1, the hover opens only on the description/body part.

This is bad when having short events of 30 minutes. Because the description is not shown, it is importend to get the hover. But the title require 90% of the event window and it is difficult to get the hover.

Please show the hover also on the title part of the event window.

Regards

Peter

Change behavior of directly following events

Hello,

when having directly following events there behavior have changed from SmartGWT3.1 to version 4.1.

Event 1 starts at 13:00 and ends at 14:00.
Event 2 starts at 14:00 and ends at 15:00.

In version 3.1 the events are not shown as overlapped events. In version 4.1 the are identified as overlapped.
(See attached screen shots)

The calendar have eventAutoArrange=true and eventOverlap=false.

Please switch back to the old fuctionality.

Regards

Peter

Attached Images
Image may be NSFW.
Clik here to view.
File Type: jpg
FollowingEvents_3.1.jpg (8.4 KB)
Image may be NSFW.
Clik here to view.
File Type: jpg
FollowingEvents_4.1.jpg (8.8 KB)
Viewing all 4756 articles
Browse latest View live