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

Fixed Scale on FacetCharts

$
0
0
Hi,

I'm using a SmartGWT4.0.pro licence.

I want to know if it is possible, and if it is, how to fix the scale of a FacetChart axis, instead of calculating it based on the data range.

e.g.: Fix the Y axis to 0 -100 when my max value is 45.

If it is not possible, are you planning to (or could you) include this on next versions?

Thanks in advance,

Felipe

How to upload a text file from client to server

$
0
0
Is there any easy way to upload a text file from the client to the server?

I see there is a file upload example but it only deals with binary data.

How can I upload a text file?

visual builder

$
0
0
Hi, i need to put a datasource with custom select... example

"select * form clients where group=1"

1.- is posbile do this from visual builder??

another question...

2.- is posible to in a select put a cookie?

"select * from clients where idclient=''& coockievar &;"

??

Thanks

Inner List Grid for related records not drawn

$
0
0
Smartclient version : Smartclient v9.0 ( SmartClient_v90p_2013-11-03_PowerEdition )

Browser : IE 9



Hi , we are seeing an issue while using expansionRelatedProperties for expanding related rows in List grid.

The actual ListGrid loads all the data fine. When we expand one of the row we are seeing this issue. The data fetch is fine. We are seeing the data come back to the client.

Case 1 : If there are less than 41 related records the inner grid is loading fine.

Case 2 : if there are 41 and more related records, we do not see the inner grid getting drawn. At this point if we click inside the blank area and minimize the browser window and maximize it, we see the inner grid drawn.

Case 3 : if there are 41 and more related records and if we have one of the columns in the inner grid commented, then we do not see any issue. The grid loads fine.

Can you let us know if we are missing any property in the innergrid which is causing it not to be drawn .

isc.ListGrid.create({
cellHeight: 18,
headerHeight : 27,
sortFieldNum: 3,
sortDirection: "descending",
alternateRecordStyles:true,
bodyOverflow:"scroll",
fields:[
{name:"xxxx", title:"XXXX", width:"488",align : "center", cellAlign: "left"},
{
name:"yyyy",
title : "YYYY",
width:"85",
wrap : true,
align : "center",
cellAlign: "right"
},
{name:"zzzz",
title:"ZZZZ",
wrap : true,
width:"90",
align : "center",
cellAlign: "right"
},
{
name:"aaaa",
title:"AAAA",
width:"*",
align : "center",
cellAlign: "right"
}
],
canReorderFields: false,
canExpandRecords: true,
canExpandMultipleRecords: true,
dataSource: 'detailOuterDS',
autoFetchData: true,
expansionMode: "related",
detailDS: 'detailsInnerDS',
expansionRelatedProperties: {
align : "center",
wrapCells: true,
height:0,
baseStyle : "cell",
cellHeight: 18,
headerHeight : 27,
sortFieldNum: 5,
sortDirection: "descending",
fixedRecordHeights: false,
showResizeBar: false,
leaveScrollbarGap: false,
showHeader: true,
showSelectedStyle: false,
bodyBackgroundColor: "#ECE9D8",
showHeaderContextMenu:false,
canResizeFields:false,
autoFitMaxRecords: 0,
dataArrived : function (startRow,endRow){
if(endRow > 7){
this.setHeight(200);
this.setAutoFitMaxHeight(200);
}
else
this.setHeight(this.headerHeight + (this.cellHeight * endRow));
},
fields:[
{name:"rrrr", title:"RRRR", width:"80", align : "center", cellAlign: "left"},
{name:"ssss", title:"SSSS", width:"185", align : "center", cellAlign: "left"},
{name:"tttt", title:"TTTT", width:"200", align : "center", cellAlign: "left"},
{
name:"uuuu",
title : "UUUU",
wrap : true,
width:"85",
align : "center",
cellAlign: "right"
},
{
name:"vvvv",
title:"VVVV",
wrap : true,
width:"90",
align : "center",
cellAlign: "right"
},
{
name:"wwww",
title:"WWWW",
width:"*",
align : "center",
cellAlign: "right"
}
]
}
})

SmartGwt click issue when into an html iFrame

$
0
0
I have a SmartGWT project (GWT2.5.1 + SmartGWT-4.0) which I want to run into a HTML iFrame. So I created normally the "Landing page" with the iFrame referring to my application.

The idea is so simple and worked very well in Chrome and Firefox, but in Internet Explorer 10, the application does not receive any mouse event, with no javascript errors.

In other words, I can navigate through the fields pressing tab and submit a form pressing enter in the button, but with the mouse I just can't do anything (ps: if I double click a link, it selects the text but do not press it out).

The pure application (running normally, out of the iFrame) does not have any issue.

Does anyone have some idea what can be happening?

MouseOut event when mouse is moved outside of drawRect instead of drawPane

$
0
0
SmartGWTPro version smartgwtpro-4.1d) from nightly build Dec 11, 2013

GWT version 2.5.1

FireFox version 26.0


In addition to mouse out event being triggered at the the wrong time, SC.show does not display message text or buttons.


public void onModuleLoad() {
DrawPane drawPane = new DrawPane();
DrawGroup drawGroup = new DrawGroup();
DrawRect drawRect = new DrawRect();

drawPane.setWidth(640);
drawPane.setHeight(480);
drawPane.setCanDrag(true);
drawPane.setBackgroundColor("#D9E4F6");
drawPane.setCursor(Cursor.AUTO);

// If group is added to drawPane before drag operation, drag operation fails
//drawPane.addDrawItem(drawGroup, true);
drawGroup.setKeepInParentRect(true);
drawGroup.setTop(0);
drawGroup.setLeft(0);
drawGroup.setWidth(50);
drawGroup.setHeight(32);
drawGroup.setCanDrag(true);
drawGroup.setUseGroupRect(true);
drawGroup.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
SC.say("yahoo!");
}
});

drawGroup.addMovedHandler(new com.smartgwt.client.widgets.drawing.events.MovedHa ndler() {
public void onMoved(com.smartgwt.client.widgets.drawing.events .MovedEvent event) {
DrawGroup drawGroup = (DrawGroup)event.getSource();
//SC.say("Group moved - left = " + drawGroup.getLeft() + " top = " + drawGroup.getTop() + " width " + drawGroup.getWidth() + " height " + drawGroup.getHeight());

};
});

drawGroup.addDragMoveHandler(new com.smartgwt.client.widgets.drawing.events.DragMov eHandler(){
// public void onDragMove(com.smartgwt.client.widgets.events.Drag MoveEvent event) {
// DrawGroup group = (DrawGroup)event.getSource();
// SC.say("Group moved - left = " + drawGroup.getLeft() + " top = " + drawGroup.getTop() + " width " + drawGroup.getWidth() + " height " + drawGroup.getHeight());
// }

@Override
public void onDragMove(DragMove dragMove) {
DrawGroup drawGroup = (DrawGroup)dragMove.getSource();
SC.say("Group moved - left = " + drawGroup.getLeft() + " top = " + drawGroup.getTop() + " width " + drawGroup.getWidth() + " height " + drawGroup.getHeight());
}
});

//Drag operation works, if it is added here
drawPane.addDrawItem(drawGroup, true);

// DrawRect
drawRect.setKeepInParentRect(true);
drawRect.setFillColor("red");

// Position on top of drawGroup
drawRect.setTop(drawGroup.getTop());
drawRect.setLeft(drawGroup.getLeft());
drawRect.setWidth(drawGroup.getWidth());
drawRect.setHeight(drawGroup.getHeight());
drawRect.setKnobs(KnobType.RESIZE);
com.smartgwt.client.widgets.drawing.events.Resized Handler rh =
new com.smartgwt.client.widgets.drawing.events.Resized Handler() {
public void onResized(com.smartgwt.client.widgets.drawing.even ts.ResizedEvent re) {
// Set size of the group
DrawRect rect = (DrawRect)re.getSource();
DrawGroup dg = rect.getDrawGroup();
dg.moveBy(rect.getLeft() - dg.getLeft(), rect.getTop() - dg.getTop());
dg.setWidth(rect.getWidth());
dg.setHeight(rect.getHeight());
//SC.say("draw rect resized moved - left = " + dg.getLeft() + " top = " + dg.getTop() + " width " + dg.getWidth() + " height " + dg.getHeight() + " rect resized moved left = " + rect.getLeft() + " top = " + rect.getTop() + " width " + rect.getWidth() + " height " + rect.getHeight());
}
};
drawRect.addResizedHandler(rh);
// Add to group
drawRect.setDrawGroup(drawGroup);
drawRect.draw();

drawPane.draw();


// Add a mouse out handler after drawing the drawpane
com.smartgwt.client.widgets.events.MouseOutHandler myMouseOutHandler =
new com.smartgwt.client.widgets.events.MouseOutHandler () {
public void onMouseOut(com.smartgwt.client.widgets.events.Mous eOutEvent event) {
SC.say("Mouse out");
}
};
drawPane.addMouseOutHandler(myMouseOutHandler);


}

how I can run a. bat from SmartGWT

$
0
0
Currently the site is running on a local network, I need a bat file is run that is located in a folder in c:\Folder\archivo.bat

How could I do to run this file from SmartGWT?

KeyBoard Navigation in UI Controls

$
0
0
Keyboard navigation from one control to another and in the GRID from one Cell to another. When user press enter key on any control like TextBox, ComboBox, Date Field then the next control should get focus and wait for user input. In the Grid ( while cell editing ) if user press Enter Key then cursor moves to next cell or if the cell is last of the grid then it should move to the first cell of next row. And again if the current row is last row then add new row to the Grid. If you have any examples like above mentioned please post in your Demo section.

IS IT POSSIBLE IN SMARTCLIENT ?

I AM NEW TO SMARTCLIENT.

Executing arbitrary command line on server?

$
0
0
Hi -- I'm in the process of evaluating SmartClient for our needs. Basically, we're looking to write a webform to generate command lines for our software (which is written in python, if that presents possibilities) and then execute the command line on our server. Because this is not a typical usage case for website design, it's harder to find answers to questions (especially since I've never designed a website before and am still learning the lingo)...

So my question is this. How do you recommend running an arbitrary command line on my server? i.e. prepare data, send data to server, run command, and return data. I'm not necessarily looking to interact with a running process on the server machine.

Here's what I've seen (to prove I've been reading the manual!) that might be adaptable to my needs:
1) It looks like maybe I could call an arbitrary cgi script. Would I integrate this with an RPC actionURL?
2) Use a RestDataSource. It looks like this deals with I/O on files, and not executables.
3) Use DMI. The problem with this appears to be that it requires writing java code which seems an unnecessarily complicated way of doing an `exec` statement. I'm also not certain how security works -- whether `exec` statements are even permitted.

Thanks for any advice!

How to format values with dounughts charts

$
0
0
Hi all,

I'm creating a doughnut facet chart like the multi series chart in the showcase (http://www.smartclient.com/smartgwtee/showcase/#multiSeriesChart_gridview).

I'd like to know to format values in each pie chart (each month) to show percentages.

Any idea on how to do that?


Note: I'm using smartgwt 4.0p

Thanks in advance

Creating Datasource from existing database

$
0
0
Hello. i want to make a date source form existing database, but i dont know how, can anyone help me with that?

Listgrid.editorExit event not fired

$
0
0
SmartClient_SNAPSHOT_v91d_2013-11-12_LGPL
Firefox 26.0 and chrome 31.0.1620.63 m

If next column is set canEdit = false and move next using TAB key, this event is not fired.
If press ENTER, then ok.
Please investigate

Thank you
Mike Shimura

Is it possible to somehow manage listgrid showprintpreview column widths?

$
0
0
OK, so in my listgrids i am quite extensively setting column widths in order to fit as much information horizontally as possible.

This is done through the usual setWidth-method in ListGridField.
I leave some fields where the length is "dynamic" unset, so that they take up all horizontal column space left. this works fine in the browser.

However, none of these widths are honored when calling the Canvas.showPrintPreview(), unfortunately, making it look really bad, many columns ending up way too wide, and sometimes splitting rows into two unnecessarily.

I did a small cutout from my pages so that you can get an image of what i mean, see attached images please.


My question is - is there any way to control how the widths are decided in the print preview? I don't HAVE to have absolute pixelation, but relative widths, at least.

Reg: Menu Items are not displaying completely in Arabic(RTL) mode

$
0
0
Hi,

Please find the attachment. We are using isc.Menu. It is working fine in English mode. But not working properly in Arabic mode.

1)Menu Items are not displaying properly. It looks like displaying some content and after that it is hidden or cut to some length. could you please investigate on the same.

2) Is there any way to hide and display the menu items depends on some conditions.

Please find the below code for menu creation:

Code:


isc.Menu.create({
        ID: "menuItemsApp",
        autoDraw: false,
        showShadow: true,
        shadowDepth: 10,
        data: [
       
                {
                        name:'menuItemMenu', title: '<fmt:message key="title.document.itemIssue"/>',
                        click:function(){
                                loadTabData(4);
                        }
                },
                {
                        name:'menuItemReports', title: '<fmt:message key="title.document.requisition"/>',
                        click:function(){
                                loadTabData(7);
                        }
                },               
       
                {
                        name:'menuItemRoleAccess', title: '<fmt:message key="title.document.purchaseRequest"/>',
                        click:function(){
                                loadTabData(20);
                        }
                },
               
                {
                        name:'menuItemMenu', title: '<fmt:message key="title.nondocument.products"/>',
                        click:function(){
                                //loadTabData(1);
                        }
                }               
/*,
                {isSeparator: true},
                {
                        title: "Windows",
                        submenu:
                        [
                                {name:'menuSubItem1', title: "data.xml", pagePath:'helloOne.jsp'},
                                {name:'menuSubItem2', title: "Component Guide.doc"},
                                {name:'menuSubItem3', title: "SmartClient.doc"},
                                {title: "AJAX.doc"}
                        ]
                }*/
        ]
});


isc.Menu.create({
        ID: "menuItemsConfiguration",
        autoDraw: false,
        showShadow: true,
        shadowDepth: 10,
        data: [
       
                {
                        title: '<fmt:message key="title.nondocument.users"/>',
                        click:function(){
                                loadTabData(19);
                        }
                },
                {
                        title: '<fmt:message key="title.nondocument.permissions"/>',
                        click:function(){
                                loadTabData(18);
                        }
                },               
       
                {
                        title: '<fmt:message key="title.nondocument.actions"/>',
                        click:function(){
                                loadTabData(16);
                        }
                },

                {
                        title: '<fmt:message key="title.nondocument.documents"/>',
                        click:function(){
                                loadTabData(15);
                        }
                },

                {
                        title: '<fmt:message key="title.nondocument.statuses"/>',
                        click:function(){
                                loadTabData(14);
                        }
                },

                {
                        title: '<fmt:message key="title.nondocument.roles"/>',
                        click:function(){
                                loadTabData(12);
                        }
                }
        ]
});

Thanks in advance

Attached Images
File Type: png Title Arabic.png (38.9 KB)

Datasource configuration with SQL Server

$
0
0
Hi,

I'm evaluating the Visual Builder, but faced problems when trying to create a listgrid with data from remote table of a MS sql server.

I successfully configured my database configuration in the admin console, and when I pressed the Test button it returned success.

Then I switch to Datasource wizard and point my table to the new datasource. The preview table successfully shows the data on the data browser, so I pressed next, modified the datasource ID, and clicked save.

Yet when I drag this datasource to the listgrid, the corresponding space keeps showing the message "Loading Data..." and never display the data.

What should I do to fix this problem?
My smartclient version is v9.0p_2013-12-11.

Transport Error - HTTP Code: 0

$
0
0
Tried to execute following with 'Hands on demo'

isc.HTMLFlow.create({
ID: "html",
width:800, height: 600,
evalScriptBlocks: true, contentsType: "page"
})

html.setContents("<script src='URL' TYPE='text/javascript'></script>");

where URL is a valid link to existing .js file and got back
Transport Error - HTTP Code: 0

However when I use html that contains that script and use following

html.setContentsURL("URL");

HTMLFlow is diplaying proper content.

Am I missing something?

Call a proc after a smartgwt INSERT

$
0
0
Dear Support,

I've got some difficulties to implement the following:
- An ADD request is issued from the client
- The Add is catched in a custom datasource, performed, and if successful we would like to call a stored procedure to do some additional work.

Code:

@Override
        public DSResponse executeAdd(DSRequest req) throws Exception {
                DSResponse response = super.executeAdd(req);
               
                if (response.getStatus() == DSResponse.STATUS_SUCCESS) {
                       
                        DSRequest request = new DSRequest(DSOperator.DS_NAME, "fetch", req.getRPCManager());
                        request.setOperationId("checkSystem");
                        request.setJoinTransaction(true);
                        DSResponse resp = request.execute();
                }
                return response;
        }

Here is the operation binding:

Code:

<operationBinding operationType="fetch" operationId="checkSystem">
                <customSQL>{call SP_SYSTEM_CHECK}</customSQL>
            </operationBinding>

The problem is that JDBC keeps telling me that the call did not return any rowset... I'm a bit surprised as the last line of my proc is a SELECT statement, and when I execute the proc in my SQL environement, it correctly shows me the returned data.

Code:

CREATE PROCEDURE SP_SYSTEM_CHECK
AS
BEGIN

        -- [...] proc code [...]
       
        SELECT 0 as ErrorCode
END
GO

Can you please advise me about what I have to change in order to achieve this ?

Many thanks,
Thomas

PS: We are using SmartGWT Power 4.0p

ListGrid editing dropped on record removal

$
0
0
Hi isomorphic,

SC Version : Smart Client version 9.0
Browser Version: FireFox 10.0.11 ( All supported and Latest Browser ).

I'm using a ListGrid in a window, in which i'm editing multiple records, if i delete any record in the middle of the grid, other below records were reindexed properly but lost any changes that were made.


Code:

ListGrid.create (isc.addProperties({
                ID                                : "NodeList",
                canEdit                        : true,
                autoFetchData  : false,
                canDrop                : false,
                canAcceptDrop        : false,
                headerHeight        : "27",
                autoSaveEdits        : false,
                autoDraw                : false,
                dataSource                : "provnode",
                editPendingCSSText:"color:#FF31DB;font-weight:bold",
                width                        : "100%",
                height                        : "100%",
                canReorderRecords: true,
                alternateRecordStyles: true,
                editEvent                : "doubleClick",

If the record is not removed then all other changes remains in the List Grid.

Record removal code :
Code:

NodeList.data.removeAt(2); ( or ) NodeList.data.remove(objectToRemove);
How to remove the listgrid record without losing any unsaved changes?

Thanks,
Ramanathan

Strange bug in DynamicForm

$
0
0
Hi,

I encountered the following problem (bug?) when using DynamicForms:

Here is my class:

Code:

class NewOperatorForm extends DynamicForm {
               
                NewOperatorForm() {
                        TextItem                        loginItem = new TextItem(DSOperator.LOGIN, "Login");
                        TextItem                nameItem = new TextItem(DSOperator.NAME, "Name");
                        TextItem                        departmentItem = new TextItem(DSOperator.DEPARTMENT, "Department");
                        TextItem                        emailItem = new TextItem(DSOperator.EMAIL, "Email");
                        SelectItem                        bunitItem = new SelectItem(DSOperator.BUNIT_ID, "Business Unit");
                       
                        bunitItem.setOptionDataSource(DataSource.get(DSBusinessUnit.DS_NAME));
                        bunitItem.setAutoFetchData(true);
                        bunitItem.setDefaultToFirstOption(true);
                       
                        this.setDataSource(DataSource.get(DSOperator.DS_NAME));
                        this.setItems(bunitItem, loginItem, nameItem, departmentItem, emailItem);
                       
                        Record r = new Record();
                        this.editNewRecord(r);
                }               
        }

You can notice that the SelectItem gets the data from another datasource and that setDefaultToFirstOption(true) is called.

The first time I create and show an instance of this dynamicform. Everything is ok: the SelectItem fetches all the data and the first item is selected by default (ID: 1).

The second time (though it's an other instance), very surprisingly, the SelectItem does contain all the items but the first one is not selected (it's blank)... but the value is instead set into the second item of the form (I've got the "1" value in my text field). This seems very odd but I did not add any code which could lead to such a behaviour...

Thanks a lot for your help!

Thomas

How to display error message

$
0
0
Hi,
I'm using Smartclient V 9.0 Professional.
When I try to delete a record from my ListGrid, I get a message (isc.warn) showing:
Code:


Server returned validation errors:[
{
        "SCHEDULE_ID":{
                "errorMessage":"Can't remove"
                }
        }
]


How can I show just the message "Can't remove"?

Regards.

The ListGrid, DataSource and DMI method Handler are as follow.

Code:


isc.ListGrid.create({
                            ID: "scheduleList",
                                top: "8%", left: "17%",
                                width:"83%", height:"91.9%",
                            dataSource: batcherScheduleDS,
                            alternateRecordStyles:true,
                            autoFetchData: true,
                            showFilterEditor: true,
                            canEdit: true,
                            editEvent: "click",
                                editByCell: true,
                            canRemoveRecords: true,
                            border: "1px solid light grey",
                            filterOnKeypress: true,
                            click:"setScheduleFormDetails();",
                            warnOnRemoval:true,
                            filterOnKeypress: true,
                                warnOnRemovalMessage:"Remove this Schedule?"
                        });

Code:

                       
                       
<operationBindings>
                <operationBinding operationType="remove" >
                        <serverObject className="operations.schedule.ScheduleOperations" methodName="remove" />                                           
                </operationBinding>
</operationBindings>

Code:

public DSResponse remove(DSRequest dsRequest)
{
        @SuppressWarnings("unchecked")
        List<Map<String, Object>> valuesList = dsRequest.getValueSets();
       
        DSResponse dsResponse = null;
        for(int i=0;i<valuesList.size();i++)
        {
                Long id = (Long)valuesList.get(i).get("SCHEDULE_ID");
               
                int statusOperation = dao.delete(Schedule.class, id);
                if(statusOperation==1)
                {
                        dsResponse=new DSResponse();
                        dsResponse.addError("SCHEDULE_ID", "Can't remove");
                        return dsResponse;
                }
        }
       
        return dsResponse=this.fetch(dsRequest);
}

Viewing all 4756 articles
Browse latest View live