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

Cannot drag a Slider with Lateral Menu

$
0
0
Using 5.0-p20150731 PowerEdition/Browser: Chrome

We have a lateral menu that we want to keep showing while the user navigates and use the system.
When the menu is open, its impossible to drag and move any Slider.
The problem is in ISC_Core.js line: 34025
(!(isc.Menu && isc.Menu._openMenus && isc.Menu._openMenus.length > 0)

Code:

        public TestView() {
                mainLayout = new VLayout();
                mainLayout.addMembers(createTestMenu(), createSlider());

                this.addChild(mainLayout);
        }

        private Canvas createSlider() {
                HLayout layout = new HLayout();

                final Slider vSlider = new Slider("Rating");
                vSlider.setMinValue(1);
                vSlider.setMaxValue(5);
                vSlider.setNumValues(5);
                vSlider.setHeight(300);
                layout.addMember(vSlider);
                return layout;
        }

        private Canvas createTestMenu() {
                HLayout layout = new HLayout();
                Menu menu = new Menu();
                menu.setAutoDismiss(false);
                menu.setAutoDismissOnBlur(false);

                MenuItem item = new MenuItem("A");
                menu.addItem(item);

                IMenuButton menuButton = new IMenuButton("Open Here and try to drag and move", menu);
                menuButton.setWidth(300);
                layout.addMember(menuButton);
               
                return layout;
        }


UploadItem setMultiple true setMultiple false not working properly

$
0
0
Isomorphic,

We are using smartgwt-pro 5.0-p20141210.
Our browser is Firefox 24.0

I have a DynamicForm with an UploadItem where depending on case I need to allow multiple file upload or single file upload.

Then on the same DynamicForm (We use the same DynamicForm, we don't perform new DynamicForm each time), i will call several times and in different order :

- uploadItem.setMultiple(true)
- uploadItem.setMultiple(false)

The behaviour i have :

- setMultiple(false)
- click on "Browse" -> I can only select one file in file chooser
- setMultiple(true)
- click on "Browse" -> I can select several files in file chooser
- setMultiple(false)
- click on "Browse" -> I can select several files in file chooser

In my tests, i see that once i have performed a setMultiple(true), i can not go back to single file selection in file chooser.

I have performed my tests in Firefox 24.0 and Firefox 38.0 and the behaviour is the same.

Can you tell me please if it's an UploadItem's component bug, a Browser bug or if it's probably a problem in my code ?

Thanks by advance.
David.

[BUG]Grouped Listgrid freezes on add with recordComponents

$
0
0
hi,
I'm experiencing a bug with a grouped ListGrid which has some recordComponents and his data is being added/edited by a DynamicForm.

Step to reproduce BUG:
1. Start editing a new record using the DynamicForm and enter some data
2. Save data by pressing on Submit
3. The new record is added to the Grid which suddenly freezes and consequently is impossible to expand or collapse groups.

I've noticed that removing the recordComponents or the grouping condition the bug disappear.

1.ISC Versions:
  • SNAPSHOT_v10.1d_2015-08-20/EVAL Development Only


2.Browser and OS: 44.0.2403.155 m (64-bit) on Windows 8.1 Pro

6. Snippet of code to test in this example page
Code:

isc.ListGrid.create({
    ID: "countryList",
    width:550, height:224, alternateRecordStyles:true, cellHeight:22,
autoDraw:false,
    // use server-side dataSource so edits are retained across page transitions
    dataSource: countryDS,
    // display a subset of fields from the datasource
    groupByField:"continent",
        showRecordComponents:true,
    showRecordComponentsByCell:true,
canRemoveRecords:true,
    fields:[
        {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
        {name:"countryName"},
        {name:"continent"},
        {name:"member_g8"},
        {name:"population"},
        {name:"independence"},
        {name:"components"}
    ],
    autoFetchData: true,
    canEdit: true,
    editEvent: "click",
createRecordComponent:function(record, colNum){
        var fieldName = this.getFieldName(colNum);
        if (fieldName == "components") {
            var recordCanvas = isc.HLayout.create({
                height: 22,
                width: "100%",
                align: "center"
            });
            var editImg = isc.ImgButton.create({
                showDown: false,
                showRollOver: false,
                layoutAlign: "center",
                src: "icons/16/comment_edit.png",
                prompt: "Edit Comments",
                height: 16,
                width: 16,
                grid: this,
                click : function () {
                    isc.say("Edit Comment Icon Clicked for country : " + record["countryName"]);
                }
            });

            var chartImg = isc.ImgButton.create({
                showDown: false,
                showRollOver: false,
                layoutAlign: "center",
                src: "icons/16/chart_bar.png",
                prompt: "View Chart",
                height: 16,
                width: 16,
                grid: this,
                click : function () {
                    isc.say("Chart Icon Clicked for country : " + record["countryName"]);
                }
            });

            recordCanvas.addMember(editImg);
            recordCanvas.addMember(chartImg);
            return recordCanvas;
        }else{
            return null;
        }
    }
});

isc.DynamicForm.create({
ID:"countryForm",
dataSource: countryDS,
autoDraw:false,
fields:[
        {name:"countryName"},
        {name:"continent"},
        {name:"member_g8"},
        {name:"population"},
        {name:"independence"},
        {name:"components"},
        {name:"SAVE", type:"submit"}
    ]
});

isc.VLayout.create({
    ID:"layoutHome",
    autoDraw:true,
    members:[countryList,countryForm]
});

multiSelectItem with groups

$
0
0
Hi all,

I created a grouped Multi SelectItem which worked and looked fine. However, I want a user to be able to select all /deselect all also in collapsed groups once he/she clicks on the SelectItem grid's header checkbox.

My idea is to expand all the groups once the user clicks on the header checkbox and depending the records' selection state I fire either a deselectAll or selectAllRecords on all groups' records.
However I can’t access the select Item’s groups. In the code below I experimented with the picklistProperties ListGrid (since it's the same ListGrid I used to set the SelectItem's groups) in the HeaderClickHandler with getGroupTree().openAll () but it is always null.

Am I missing out something? Please look at my code and provide me with clues on how I can achieve “select all/deselect all" on all records (including collapsed groups) of a grouped multi SelectItem

Thanks

Code:

private static FormItem createGroupedSelectItem() {
        final SelectItem item = new SelectItem(); // field left out

        item.setPickListFields(new ListGridField("name"), new ListGridField("type"));
        item.setPickListWidth(400);

        item.setAllowEmptyValue(false);
        item.setMultiple(true);
        item.setDisplayField("name");
        final ListGrid picklistProperties = new ListGrid() {
            {
                setGroupByField("type");
                setShowFilterEditor(true);
                setBackgroundColor("white");
                setSort(new SortSpecifier[] { new SortSpecifier("type", SortDirection.ASCENDING),
                        new SortSpecifier("name", SortDirection.ASCENDING) });
            }
        };

        picklistProperties.addHeaderClickHandler(new HeaderClickHandler() {

            @Override
            public void onHeaderClick(HeaderClickEvent event) {

                if (event.getFieldNum() == 0) {
                    item.getClientPickListData();
                    if (picklistProperties.getSelectedRecord() != null) {
                        picklistProperties.getGroupTree().openAll();
                        picklistProperties.deselectAllRecords();
                    }

                }

            }
        });

        item.setPickListProperties(picklistProperties);
        return item;
    }

Tree grid columns getting misaligned

$
0
0
We are using..
a) SmartClient Version: SNAPSHOT_v10.1d_2015-08-16/Pro Deployment (built 2015-08-16)
b) Testing using IE 11.0.9600.17126


we are experiencing similar issues with the TreeGrid that you have addressed on the ListGrid

In the test sample, we added the following buttons:

a) "setFieldTitle and showFields"

This button populates the columns under the header span called "Bal To pieces" at runtime, you will see that the columns are not getting aligned with the Header Titles
Please see the attachment "setFieldTitle_and_showFields.png"

b) "showFields and setFieldTitle"

Then if you revert the sequence, all columns get aligned but the "Bal to pieces" is not being autofit.
Please see the attachment "showFields_and_setFieldsTitle.png"

c) "autoFitFields"
autoFitFields() on the tree grid solved the issue of the column data alignment in regards to the headers but it now created the issue of the Header span title being cut off.
Please see the attachment "autoFitFields.png"

We have used following styles for the tree grid.
Code:


.tallCell,
.tallCellDark,
.tallCellOver,
.tallCellOverDark,
.tallCellSelected,
.tallCellSelectedDark,
.tallCellSelectedOver,
.tallCellSelectedOverDark,
.tallCellDisabled,
.tallCellDisabledDark,
.gridSummaryCell,
.gridSummaryCellDisabled,
.recordSummaryCell,
.recordSummaryCellDark,
.recordSummaryCellOver,
.recordSummaryCellOverDark,
.recordSummaryCellSelected,
.recordSummaryCellSelectedDark,
.recordSummaryCellSelectedOver,
.recordSummaryCellSelectedOverDark,
.recordSummaryCellDisabled,
.recordSummaryCellDisabledDark,
.expansionCellCell,
.expansionCellCellDark,
.expansionCellCellOver,
.expansionCellCellOverDark,
.expansionCellCellSelected,
.expansionCellCellSelectedDark,
.expansionCellCellSelectedOver,
.expansionCellCellSelectedOverDark,
.expansionCellCellDisabled,
.expansionCellCellDisabledDark,
.specialCol,
.specialColOver,
.specialColSelected,
.specialColSelectedOver,
.specialColDisabled,
.groupNode,
.redCellColor,
.orangeCellColor,
.purpleCellColor,
.yellowCellColor,
.greenCellColor,
.greyCellColor,
.yellowOddCellBorderColor,
.yellowEvenCellBorderColor
{
  font-family:Arial,Verdana,sans-serif;
  font-size:14px ;
  text-overflow:ellipsis;
 
  padding-bottom: 3px ; 
  padding-top: 3px ; 
  padding-right: 5px ; 
  padding-left: 5px ; 
 
  border-bottom:1px solid #D0D0D0; border-right:1px solid #D0D0D0 ;
}


.cellSelected,
.cellSelectedDark,
.specialColSelected,
.recordSummaryCellSelected,
.tallCellSelected,
.tallCellSelectedDark,
.treeCellSelected,
.treeCellSelectedDark,
.treeTallCellSelected,
.treeTallCellSelectedDark,
.tallPickListCellSelected,
.tallPickListCellSelectedDark
.recordSummaryCellSelectedDark {
        font-family:Arial, Verdana, sans-serif; font-size:14px ;  color: #2F4F4F;
  background: #C1D6F0;
  border-bottom: 1px dotted #9fb7e9;
  border-top: 1px dotted #9fb7e9;
}

.cellDark,
.recordSummaryCell,
.recordSummaryCellDark,
.tallCellDark,
.treeTallCellDark {
        font-family:Arial, Verdana, sans-serif; font-size:14px ;  color: #2F4F4F;
  background-color: #EBF0F4;
  border-top:1px solid #EBF0F4;
 
}


/* ListGrid column header buttons */
.headerButton,
.headerButtonSelected,
.headerButtonDisabled,
.headerButtonSelectedDisabled,
.headerButtonOver,
.headerButtonDown,
.headerButtonSelectedOver,
.headerButtonSelectedDown {
    font-family:Arial, Verdana, sans-serif; font-size:14px ; font-weight: bold; color: #2F4F4F;
    cursor: pointer;
    padding-left: 5px;
    padding-right: 5px;
}

.headerButtonDisabled {
    color:#3E3E3E;
}

.headerButtonSelectedDisabled {
    color:#3E3E3E;
}

/* ListGrid column header titles */
.headerTitle,
.headerTitleOver,
.headerTitleDown,
.headerTitleSelected,
.headerTitleSelectedOver,
.headerTitleSelectedDown,
.headerTitleDisabled,
.headerTitleSelectedDisabled {
    font-family:Arial, Verdana, sans-serif; font-size:14px ; font-weight: bold;
    cursor: pointer;
}

.headerTitleDisabled,
.headerTitleSelectedDisabled {
    color:#3E3E3E;
}

.myTreeCell,
.myTreeCellDark,
.myTreeCellOver,
.myTreeCellOverDark,
.myTreeCellSelected,
.myTreeCellSelectedDark,
.myTreeCellSelectedOver,
.myTreeCellSelectedOverDark,
.myTreeCellDisabled,
.myTreeCellDisabledDark,
.myTreeTallCell,
.myTreeTallCellDark,
.myTreeTallCellOver,
.myTreeTallCellOverDark,
.myTreeTallCellSelected,
.myTreeTallCellSelectedDark,
.myTreeTallCellSelectedOver,
.myTreeTallCellSelectedOverDark,
.myTreeTallCellDisabled,
.myTreeTallCellDisabledDark {
 
  font-family:                Arial,Verdana,sans-serif;
  font-size:                14px;
  text-overflow:        ellipsis;
 
  padding-bottom:        3px;
  padding-top:        3px; 
  padding-right:        5px;   
  padding-left:        5px;
 
  border-bottom:        1px solid #D0D0D0;
  border-right:        1px solid #D0D0D0;
  border-top:                1px solid #D0D0D0;
 
}


TIleConstructor and BeanFactory

$
0
0
SmartClient Version: v9.0p_2013-07-14/LGPL Development Only (built 2013-07-14)
GWT 2.6.0
Firefox 26, Classic Dev Mode

Hi there,

following the CustomTile example in the showcase I'm getting the following error:
Code:

14:00:24.862 [ERROR] [ns] Generator 'com.smartgwt.rebind.MetaBeanFactoryGenerator' threw an exception while rebinding 'com.arplatia.ns.client.informe.fotoPeritaje.widget.FotoTileGrid.FotoTileMetaFactory'
java.lang.NullPointerException: null
    at com.smartgwt.rebind.BeanValueType.<init>(BeanValueType.java:134)
    at com.smartgwt.rebind.BeanClass.getValueTypes(BeanClass.java:411)
    at com.smartgwt.rebind.BeanClass.writeRegisterValueTypes(BeanClass.java:420)
    at com.smartgwt.rebind.BeanClass.generateFactory(BeanClass.java:283)
    at com.smartgwt.rebind.BeanClass.generateFactory(BeanClass.java:295)
    at com.smartgwt.rebind.MetaBeanFactoryGenerator.generate(MetaBeanFactoryGenerator.java:113)
    at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:676)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:147)
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:600)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:470)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
    at com.google.gwt.core.shared.GWT.create(GWT.java:72)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at com.arplatia.ns.client.informe.fotoPeritaje.widget.FotoTileGrid.<init>(FotoTileGrid.java:19)
    at com.arplatia.ns.client.informe.peritacion.widget.PeritacionWindowDynamicForm.<init>(PeritacionWindowDynamicForm.java:627)
    at com.arplatia.ns.client.informe.peritacion.GestionPeritaciones.<init>(GestionPeritaciones.java:59)
    at com.arplatia.ns.client.principal.PrincipalArplatiaNS$8.onClick(PrincipalArplatiaNS.java:620)
    at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:102)
    at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:228)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.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:576)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:347)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)

What are we doing wrong with the BeanFactory? Is more code needed to make the showcase example work? We define the Tile and the TileGrid as follows:

FotoTile.java
Code:

public class FotoTile extends DynamicForm {
        public FotoTile() {
                StaticTextItem pictureItem = new StaticTextItem("nombre");
                pictureItem.setShowTitle(false);
                pictureItem.setCanEdit(false);
                pictureItem.setImageURLPrefix("ns?thumbnail=true&filename=");
                pictureItem.setShowValueIconOnly(true);
                pictureItem.setValueIconHeight(150);
                pictureItem.setValueIconWidth(150);
                pictureItem.setValueIconMapper(new ValueIconMapper() {
                        @Override
                        public String getValueIcon(Object value) {
                                return String.valueOf(value);
                        }
                });

                // More fields and buttons
               
                setFields(pictureItem);
        }
}

And the FotoTileGrid.java

Code:

public interface FotoTileMetaFactory extends BeanFactory.MetaFactory {
                BeanFactory<FotoTile> getFotoTileFactory();
        }

public FotoTileGrid() {
                GWT.create(FotoTileMetaFactory.class);

                // Configurar TileGrid
                setDataSource(FotoDS.getInstance());
                setTileWidth(TILE_SIZE);
                setTileHeight(TILE_SIZE);
               
                // setTileConstructor() is not resolved, I don't know why
                setAttribute("tileConstructor", "FotoTileMetaFactory", false);
        }

Grid Components for Select Item

$
0
0
Hi,

I have a problem with Select Item having Grid Embibed as Picklist property.

The only problem I have is, I am using Grid components and in which I am not able to get Grid Summary row in that.

This was working until upgrade my smart GWT from 4 to 5.
So in this Latest SmartGWT 5 version I could not get Grid Summary for Select Item.

Please help me in this.
Thank you in advance.

Dialog will not show single toolbar button

$
0
0
SmartClient Version: v10.0p_2015-08-20/PowerEdition Deployment (built 2015-08-20)

Tested only with Firefox


I've got a progress dialog that is displayed with a single button to cancel the request. This dialog did not have any issues in SmartGWT 4.0, but after upgrading to SmartGWT 5.0, the cancel button is no longer displayed.

I have a PleaseWaitDialog that extends Dialog and does the following:

Code:

this.cancelButton = new Button( "Cancel" );
this.setToolbarButtons( this.cancelButton );

When it is executed, it shows the dialog as displayed in the attachment OneButton.PNG

---
Other dialogs in the software still work with SmartGWT 5.0 for displaying buttons. The only difference I could see was the number of buttons. Therefore, I added another button:

Code:

this.cancelButton = new Button("cancel" );
Button fakeButton = new Button( "f" );
this.setToolbarButtons( this.cancelButton, fakeButton );

When executed, it shows the dialog with buttons as displayed in attachment WithFakeButton.PNG
---

I tried forcing the toolbar to show with a call to setShowToolbar(true), but this made no difference. The only way I was able to show a single button was to create a fake hidden button:

Code:

this.cancelButton = new Button("cancel" );
Button fakeButton = new Button( "f" );
fakeButton.hide();
this.setToolbarButtons( this.cancelButton, fakeButton );

When executed, it shows the dialog with the single button as displayed in attachment WithFakeButtonHidden.PNG


Is there something I could be doing incorrectly for a single button?

Attached Images
File Type: png OneButton.PNG (3.3 KB)
File Type: png WithFakeButton.PNG (4.1 KB)
File Type: png WithFakeButtonHidden.PNG (3.9 KB)

Form has changed values for unmodified record.

$
0
0
Isomorphic,

There appears to be an issue with forms reporting changed values even though the record has not been modified . It appears to be related to the field value being an empty string.

I only see this issue with IE.

I'm using IE11 and SNAPSHOT_v10.1d_2015-08-06/Pro Deployment (built 2015-08-06).

I've modified the following showcase sample to illustrate the issue.

http://www.smartclient.com/smartgwt/..._form_category

I changed the RecordClickHandler to log the changed values since I want to detect if there are unsaved changes on the form before selecting the new record.

Code:

listGrid.addRecordClickHandler(new RecordClickHandler() {
            public void onRecordClick(RecordClickEvent event) {
                Map changedValues = form.getChangedValues();
                SC.logInfo("Changed Values: " + changedValues);
                form.reset();
                form.editSelectedData(listGrid);
            }
        });

I also changed the description for one of the records to an empty string.

Code:

new ItemRecord(2, "Glue Pelikan Roll-fix Refill Permanent #955", "1089400", "", "Rollfix Glue", "Ea", 3.73, null, null)
As you select different records in the list (without making any changes to the form), you'll eventually see the description field get logged as a changed value.

Code:

16:03:44.988:INFO:Log:initialized
16:03:45.326:INFO:Log:isc.Page is loaded
16:03:53.281:pointerup5:INFO:Log:Changed Values: {}
16:03:54.976:pointerup4:INFO:Log:Changed Values: {}
16:04:01.384:pointerup0:INFO:Log:Changed Values: {}
16:04:06.880:pointerup4:INFO:Log:Changed Values: {description=}
16:04:10.144:pointerup7:INFO:Log:Changed Values: {description=}
16:04:11.296:pointerup0:INFO:Log:Changed Values: {}
16:04:12.008:pointerup1:INFO:Log:Changed Values: {}
16:04:12.799:pointerup3:INFO:Log:Changed Values: {}
16:04:13.424:pointerup5:INFO:Log:Changed Values: {description=}

Thanks.

HTTP/2 Performance Improvement

$
0
0
Hi There,

This isn't really a question... more of an exciting observation.

I've been playing around with HTTP/2, and found that SmartGWT performance is given a huge improvement over HTTP 1.1.

The performance improvement on initial load times for my SmartGWT application is conservatively around 500%.

I strongly recommend that HTTP/2 is considered for all deployments when using SmartGWT (I assume this will apply to SmartClient too).

Regards,
Nick

how can i write criteria for nested datasource

$
0
0
data:[{
contactID:15,
contactEmail:"sdfsdfdsf",
account:{
accountID:2,
accountDetails:null,
accountPassword:"2222",
contact:[
{
contactID:14,
contactEmail:"sdfsdfsdf",
account:null,
contactTel:"sdfsdf",
contactAddress:"xcvxv"
},
null,
{
contactID:16,
contactEmail:"12212121212",
account:null,
contactTel:"121212121212",
contactAddress:"sdfdsfsdf"
}
],
accountRole:2,
accountUsername:"2"
},
contactTel:"sdfsdfds",
contactAddress:"dfvsdfdsf"
},


account ds

<DataSource
ID="account"
serverType="hibernate"
beanClassName="jpac.express.domain.Account"
schemaBean="jpac.express.domain.Account">
<field name="contact" type="contact" multiple="true" hidden="true" foreignKey="contact.accountID" />
<field name="accountDetails" type="accountDetails" hidden="true" foreignKey="accountDetails.accountID" />
<field name="accountRole">
<valueMap>
<value ID="1">test1</value>
<value ID="2">test2</value>
<value ID="3">test3</value>
</valueMap>
</field>
</DataSource>

contact ds
<DataSource
ID="contact"
serverType="hibernate"
beanClassName="jpac.express.domain.Contact"
schemaBean="jpac.express.domain.Contact">
</DataSource>

i want to select from contact ds where accountID is 2

Combo Box value returning NULL

$
0
0
Hello there,

I am using SmartClient Version: v10.0p_2015-07-08/PowerEdition Deployment (built 2015-07-08) with FF26.

I have 2 components, a Combo Box and a listgrid. The user user selects a value from a combo box and then fills some data in the listgrid. Now when the user clicks the save button I want to save the CB id and the data in the listgrid in a database table but for some reason the combo box value is not saving.

cheers
Zolf

Code:

distributorName = new ComboBoxItem();
distributorName.setName("mfk");
distributorName.setDisplayField("name");
distributorName.setValueField("id");
distributorName.setWidth(170);
distributorName.setTitle("Select Distributor");
distributorName.setPickListWidth(250);
distributorName.setOptionDataSource(ds1);

Code:


if (StringUtills.isNull(record.getAttribute("mfk"))
                                                        && !StringUtills.isNull(oldGridRecord.getAttribute("mfk")))
                                        {
                                                listGridRecord.setAttribute("mfk", oldGridRecord.getAttribute("mfk"));
                                        }

and on the server side I have this code

Code:

if (values.containsKey("mfk"))
                {
                        if (!StringUtills.isNull(values.get("mfk").toString()))
                        {
                                String numbervalue = values.get("mfk").toString().trim().replace(",", "");
                                if (StringUtills.isNumber(numbervalue))
                                {
                                        newValues.put("mfk", Integer.parseInt(numbervalue));
                                }
                        }
                }

Multitenant with JPA

$
0
0
Greetings,

I use jpa with EclipseLink.
isomorphic.version = 10.0-p20150731

And I have problem when i try to fetch data from @Multitenant beans.
I override IDACall and in the handleDSRequest and try to set tenantId to EntityManager.

@Override
public DSResponse handleDSRequest(DSRequest dsRequest, RPCManager rpc, RequestContext context) throws Exception {
DataSource dataSource = dsRequest.getDataSource();
EntityManager em = EMF.getEntityManager(dataSource.getConfigName());
em.setProperty(EntityManagerProperties.MULTITENANT_PROPERTY_DEFAULT, "domain:1");

return super.handleDSRequest(dsRequest, rpc, context);
}

But I always get: No value was provided for the session property [eclipselink.tenant-id]... These properties must be set through Entity Manager
Is that the right way?
I must set be able to set tenant Id on every request.



<isomorphic.version>10.0-p20150731</isomorphic.version>

<DataSource
ID="posConfig"
serverType="jpa"
beanClassName="hr.ips.gm.model.expanse.PosConfigValue"
>
</DataSource>


Exception Description: No value was provided for the session property [eclipselink.tenant-id]. This exception is possible when using additional criteria or tenant discriminator columns without specifying the associated contextual property. These properties must be set through Entity Manager, Entity Manager Factory or persistence unit properties. If using native EclipseLink, these properties should be set directly on the session.
Query: ReportQuery(referenceClass=PosConfigValue sql="SELECT COUNT(id) FROM pos_config_value WHERE (TENANT_ID = ?)")
12:29:10.153 - WARN c.i.servlet.RequestContext - dsRequest.execute() failed:
javax.persistence.PersistenceException: Exception [EclipseLink-6174] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
Exception Description: No value was provided for the session property [eclipselink.tenant-id]. This exception is possible when using additional criteria or tenant discriminator columns without specifying the associated contextual property. These properties must be set through Entity Manager, Entity Manager Factory or persistence unit properties. If using native EclipseLink, these properties should be set directly on the session.
Query: ReportQuery(referenceClass=PosConfigValue sql="SELECT COUNT(id) FROM pos_config_value WHERE (TENANT_ID = ?)")
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at com.isomorphic.jpa.JPADataSource.executeFetch(JPADataSource.java:712) ~[isomorphic-jpa-10.0-p20150731.jar:na]
at com.isomorphic.datasource.DataSource.execute(DataSource.java:1922) ~[isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.jpa.JPADataSource.execute(JPADataSource.java:652) ~[isomorphic-jpa-10.0-p20150731.jar:na]
at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726) ~[isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658) ~[isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.application.AppBase.execute(AppBase.java:491) ~[isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2548) ~[isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at hr.ips.gm.web.isomorphic.SecureIDACall.handleDSRequest(SecureIDACall.java:46) [classes/:na]
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at hr.ips.gm.web.isomorphic.SecureIDACall.processRequest(SecureIDACall.java:31) [classes/:na]
at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar:3.1.0]
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156) [isomorphic-core-rpc-10.0-p20150731.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:751) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1666) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:171) [websocket-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1636) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1653) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1645) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:564) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578) [jetty-security-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:498) [jetty-servlet-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:98) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.Server.handle(Server.java:461) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:284) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244) [jetty-server-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534) [jetty-io-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) [jetty-util-9.2.0.v20140526.jar:9.2.0.v20140526]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) [jetty-util-9.2.0.v20140526.jar:9.2.0.v20140526]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
Caused by: org.eclipse.persistence.exceptions.QueryException:
Exception Description: No value was provided for the session property [eclipselink.tenant-id]. This exception is possible when using additional criteria or tenant discriminator columns without specifying the associated contextual property. These properties must be set through Entity Manager, Entity Manager Factory or persistence unit properties. If using native EclipseLink, these properties should be set directly on the session.
Query: ReportQuery(referenceClass=PosConfigValue sql="SELECT COUNT(id) FROM pos_config_value WHERE (TENANT_ID = ?)")
at org.eclipse.persistence.exceptions.QueryException.missingContextPropertyForPropertyParameterExpression(QueryException.java:266) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:277) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.translate(DatabaseCall.java:1102) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:241) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2738) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2675) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:848) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469) ~[eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
... 46 common frames omitted

autoDeriveSchema=“true" & "Must be a Whole Number"

$
0
0
Be sure your post includes:

1. v9.1p_2015-08-19/PowerEdition Deployment (built 2015-08-19)

2a. Chrome Version 44.0.2403.157 (64-bit)
2b. Firefox 40.0.2

Hopefully this will be easy to replicate. I have a datasource that points to a table (SQL Server 2005 and SQL Server 2008) that contains a "bit" type field (sqlType="bit") and we set it to a type of boolean. It creates a checkbox on the form. It looks like:
Code:

<field name="SOME_RANDOM_FLAG" title="Ready to Rock?" sqlStorageStrategy="number" sqlType="bit" sqlLength="1" />
If I add ' autoDeriveSchema=“true" ' to the datasource tag in the same file, the checkbox generates a validation error whenever the checkbox is changed: "Must be a Whole Number".

Code:

<DataSource serverType="sql" dbName="SQLServer" schema="dbo" autoDeriveSchema=“true" tableName="RandomTable" ID="RandomTable">
I think the problem lies within the autoDeriveSchema attribute somewhere, because it works fine without that option enabled.

If it can't be replicated, let me know and I'll see if I can come up with some generic code to recreate it.

Paul Fincke

DynamicForm behavor change issue.

$
0
0
Hi,

We have an issue reported from one of our customers who is upgrading from our product with old SmartClient build (v8.3p_2013-06-11/PowerEdition) to the product with the current 8.3 build (v8.3p_2015-05-05/PowerEdition) regarding to the DynamicForm behaviour change.

In v8.3p_2013-06-11/PowerEdition, if the defined column widths cannot fill the whole width of the DynamicForm, the width of each column will be expanded according to the relative proportions of the defined column widths. In v8.3p_2015-05-05/PowerEdition, the defined column widths will be strictly applied even if the whole width of the containing Grid Layout is not fully filled. For example, if the column widths are defined to be [300, 300], it does not fill the width of the DynamicForm. Previously, each column will take 50%, 50% of the Grid Layout width respectively and each element in the DynamicForm with "*" width will take the defined "300px" width, but now each column will strictly take 300px, 300px respectively.

To get the previous behaviour, we suggest our customer to modify the code to Change the column widths to [50% 50%] and then modify the width of all elements under first columns to be 300px and the width of all elements under second columns to be 300px as well.

However, it is not acceptable by our customer as they have more than 400 complex DynamicForms with many elements to change. It is time consuming and we got very strong feedback from them.

We are wondering if there is easier way we can get the old behaviour back? Is it a backward compatibility issue? If so, please help with solutions.

Thanks,
Robin

Please check the following standalone for reference:

Code:

isc.DynamicForm.create({
    ID: "exampleForm",
    width: "100%",
        numCols: 2,
        colWidths: [300,300],
        titleOrientation: "top",
    fields: [
        {name: "username",
        title: "Username",
        type: "text",
        required: true,
        defaultValue: "bob",
                width: "*"
        },
        {name: "email",
        title: "Email",
        required: true,
        type: "text",
        defaultValue: "bob@isomorphic.com",
                width: "*"
        },
        {name: "password",
        title: "Password",
        required: true,
        type: "password",
                width: "*"
        },
        {name: "password2",
        required: true,
        title: "Password again",
        type: "password",
                width: "*"
        }
    ]
});


Attached Images
File Type: jpg Previous.JPG (16.9 KB)
File Type: jpg Now.JPG (18.0 KB)

open tab day by default in calendar

$
0
0
I can open as the default tab day on the calendar widget?

SGWT application not forwarding from html to sgwt application

$
0
0
Hello there,

I am using SmartClient Version: v10.0p_2015-07-08/PowerEdition Deployment (built 2015-07-08) along with FF26.

I have a simple HTMLpage which presents the login page and then if the credential is correct I forward it to my main sgwt application's HTML page.
Locally it is working, I mean in dev mode. But when I setup it on the Tomcat, I get to see the login page but then I get to see only a blank page. Can somebody please help me analysis why this is happening or what I am missing out.
The configuration.properties file for dev mode looks like so,
Code:

app.landingpage.url=http://127.0.0.1:8889/KaiBe.html?gwt.codesvr=127.0.0.1:9997
app.loginpage.url=http://127.0.0.1:8889/login.html

and the Tomcat version I change to this

Code:

app.landingpage.url=http://localhost:8080/KaiBe/KaiBe.html
app.loginpage.url=http://localhost:8080/KaiBe/login.html

Little background as to what I have done.

I have a simple HTML file which forwards the page to a servlet,like so
Code:

<form method="post" action="loginApp">
web.xml contains the servlet definition

Code:

<servlet>
                <servlet-name>AppLoginServlet</servlet-name>
                <servlet-class>com.beh.server.login.LoginServlet</servlet-class>
        </servlet>
        <servlet-mapping>
                <servlet-name>AppLoginServlet</servlet-name>
                <url-pattern>/loginApp</url-pattern>
        </servlet-mapping>

I have also attached my LoginServlet.java file.

cheers
Zolf

Attached Files
File Type: java LoginServlet.java (1.6 KB)

Calendar days not accessible via keyboard

$
0
0
The Calender widget shown in the showcase here: http://www.smartclient.com/smartgwt/showcase/#compact_calendar_category is not accessible via the keyboard. I can only access the first column and I cannot activate the DayBodyClickHandler by pressing the enter key. Is this a bug or something I can set manually somewhere?

Bug using cacheAcrossOperationIds false [Fix included]

$
0
0
Version: Smartclient V100p_2015-08-10_LGPL.

Given:
Code:

isc.RestDataSource.create({
  ID:'Bug',
  cacheAllData:true,
  cacheAcrossOperationIds:false,
  cacheAllOperationId:'selectOptions'
})

The problem:
If you do a first fetch on the dataSource with selectOptions operationId the cache is nicely filled. But if you do a second fetch with an other operationId, the fetch fails.

The failing code is:
ISC_DataBinding.js@25780:
Code:

this.addMethods({
  transformRequest : function (dsRequest) {
      var isServerRequest =
              (dsRequest.cachingAllData ||
              (dsRequest.operationType && dsRequest.operationType != "fetch"));
      if (!isServerRequest) return dsRequest;
      return this.transformServerRequest(dsRequest);
  },
  transformResponse : function (dsResponse,dsRequest,data) {
    var isServerRequest =
            (dsRequest.cachingAllData ||
            (dsRequest.operationType && dsRequest.operationType != "fetch"));

    if (!isServerRequest) {
        var cacheAllDataTime = this._autoCacheAllData_timestamp,
            sentTime = dsRequest._sentTime;

        if (!cacheAllDataTime || !sentTime || sentTime >= cacheAllDataTime)
            return dsResponse;
    }
    return this.transformServerResponse(dsResponse,dsRequest,data);
  }
});

Why is it failing?
On the firstCacheAllDataRequest the transformRequest of the DataSource is overridden with a function which only fires if the request is an actual server request. This code does not take the option cacheAcrossOperationIds in consideration.

A possible fix:
Code:

this.addMethods({
          isServerRequest: function(dsRequest){
                  return dsRequest.cachingAllData ||
                          (this.cacheAcrossOperationIds && (dsRequest.operationType && dsRequest.operationType != "fetch"))||
                          (this.cacheAcrossOperationIds===false && this.cacheAllOperationId!==(dsRequest.operationId||dsRequest.operation))
          },
    transformRequest : function (dsRequest) {
        if (!this.isServerRequest(dsRequest)) return dsRequest;
        return this.transformServerRequest(dsRequest);
    },
    transformResponse : function (dsResponse,dsRequest,data) {
        if (!this.isServerRequest(dsRequest)) {
            var cacheAllDataTime = this._autoCacheAllData_timestamp,
                sentTime = dsRequest._sentTime;

            if (!cacheAllDataTime || !sentTime || sentTime >= cacheAllDataTime)
                return dsResponse;
        }
        return this.transformServerResponse(dsResponse,dsRequest,data);
    }
});

com.isomorphic.datasource.DSResponse constructor throws exception

$
0
0
Hi Isomorphic,

using a two weeks old version of 5.0p this worked:
Code:

com.isomorphic.datasource.DSResponse mockedResponse = new DSResponse(ds, DSResponse.STATUS_SUCCESS);//ds is DataSource
Now, with v10.0p_2015-08-21 this throws exception and therefore needs to be wrapped in try/catch.

I did not expect such a change within a p-version. Are such signature changes expected to happen?

Best regards
Blama
Viewing all 4756 articles
Browse latest View live