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

How to determine Lane in Timeline over a drag/drop operation

$
0
0
SmartGWT 4.0p

We drag ListGrid record over Timeline component. We have all the information to construct correct CalendarEvent BUT no information over which lane object has been dropped ....

How can I get this information ?

Below is how we handle drag/drop operation:

Code:

this.planning.addDropHandler(new DropHandler() {
   
    @Override
    public void onDrop(DropEvent event) {
       
        Object dragTarget = EventHandler.getDragTarget();
       
        ListGridRecord rec = ((ListGrid)dragTarget).getSelectedRecord();
        CalendarEvent newCalEvent = planning.createEventFromListGridRecord(rec);
       
        ds.addData(newCalEvent);
    }
   
)};


How to start using DynamicDSGenerator

$
0
0
I Need to create a DataSource Dynamically. The amount of fields or the fields name will be available only at runtime.
I have a list of an object which other embedded lists. And all the data need to be displayed in one DataGrid as a single record.
For the fetch:

RestDataSource dsFields = new RestDataSource();
dsFields.setDataFormat(DSDataFormat.JSON);
dsFields.setFetchDataURL(url);

With the response received, I am not able to read the data as a embedded list. With 'response.getDataAsRecordList()' , I get only one level in the list. I have another level.
If I am able to loop the response, I can use the method addField to create the correctDataSource to display in a Datagrid.
Record1 {
name,
age,
DOB,
address{
line1, line2, town},
PhoneNo{
phone1, phone2},
.
.
.
}
I have been able to loop though Record1 to get name, age, DOB, and adress as a attribute not a new embedded list.

Also I had also tried to start using DynamicDSGenerator, But this am not able to get the jar com.isomorphic
Is com.isomorphic in the professional edition?

I am using SmartGWT/4.1d

Is com.isomorphic in the professional edition?

$
0
0
To be able to use DynamicDSGenerator - Should it be from the professional edition? or is it free.
Nowhere to download: isomorphic_core_rpc.jar

Thanks

Export to xml (in memory)

$
0
0
Well, we have a listGrid from which we want to get out the results onto a custom PDF (generated through iText, etc), then the main idea, is to generate a xml data to send it to our java method which generates PDF file.
The problem/question is how to get this xml data "on memory" and not to download, I mean, we are searching a solution in this way:

Code:

myGrid.exportData({exportAs: "xml",
                                  exportToClient: true  // To achieve get to function callback
                                  function (dsResponse, data, dsRequest) {
                                                ...
                                                // Don't we should get xml result in this callback?
                                                ...
                                                // If we will get xml here, then we could send it to our Java custom PDF method (or any other subroutine)
                                  }
);

But always we get data is for download, and not in callback, so this is not valid for us.
What do we wrong?
What do you suggest to achieve our objective?

Thanks in advance.


We are working under:
v9.0p_2013-08-20/PowerEdition Development SC and IExplrorer 10.0.9200 navigator, Eclipse Helios and Tomcat 7.0.28

dynamic form sizing

$
0
0
Hi - I am having a difficult time trying to figure out why my sizing does not work and I have narrowed it down to dynamic forms. Below I have a simple sample of a vertical layout. I have set my width to be 486px. Then I add a dynamic form with column widths that add up to what I have specified as the width of the form. When I run this sample and I use firebug to determine the size of the vertical layout, it has grown to 494px. My question is why? Is there padding somewhere that I cannot see? Clearly the form should not take that much room based on my setup. Once I remove the form and only have the button, the vertical layout retains the size I have specified (486px).

My second question (not as important) - "fixedColWidths" from what I can understand tells you to use the column widths that I have specified but I do not see this happening unless I put "width: '*'" for each form item. Why is that?


I am using SmartClient_v83p_2013-08-15_PowerEdition
I also tried with :
SmartClient_v90p_2013-11-20\smartclientSDK

Code:


<HTML><HEAD><TITLE>Test Show All</TITLE>

<HTML><HEAD><TITLE>Test Show All</TITLE>
   
</HEAD>
<body class="pageBackground" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no" style="overflow:hidden">


<meta content="text/html; charset=UTF-8" http-equiv="content-type">

<SCRIPT>var isomorphicDir = "isomorphic/"</SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_Core.js></SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_Containers.js></SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_Grids.js></SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_Forms.js></SCRIPT>
                <SCRIPT SRC=/isomorphic/system/modules/ISC_FileLoader.js></SCRIPT>
    <SCRIPT SRC=/isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
        <SCRIPT SRC=/isomorphic/skins/Mobile/load_skin.js></SCRIPT>


<SCRIPT>
isc.VLayout.create({width: 486,members:[
isc.DynamicForm.create({
    ID: "exampleForm",titleOrientation: "top",
fixedColWidths:true,
    colWidths: [150,150,50,50],width: 400,
numCols: 4,
    fields: [
        {name: "username",
        title: "Username",
        type: "text",
        required: true,
                width:"*",
        defaultValue: "bob"
        },
        {name: "email",
        title: "Email",
        required: true,
        type: "text",
        defaultValue: "bob@isomorphic.com"
        },
        {name: "password",
        title: "Password",
        required: true,
        type: "password",
                width:"*"
        },
        {name: "password2",
        required: true,
        title: "Password again",
                width:"*",
        type: "password"
        }
    ]
}), isc.Button.create({title:"test"})]});

</script>
<p>


</BODY>
</html>

Any IDEA 13.x users?

$
0
0
GWT 2.5.1, SmartGWT 3.x

I'm changed over from NetBeans to Idea 13.x. Are there any users on Idea for their IDE? I have a question for those using Idea:

When running in debug mode - to be able to set a break point in the client code and step through it - what is the trick to get this to work? I currently have my application running, however, when I set a break point in the client code, it does not work?

cubegrid rows not aligned in firefox 24.2

$
0
0
SmartClient v90p_2013-12-19
firefox24.2
IE9, Chrome30

In IE9 and Chrome 30, the data rows line up correctly with the row labels. In firefox 24.2, they do not (firefoxcubegrid.jpg). I'm also able to get the rows to misalign in IE by collapsing and expanding dimensions. The listDataTest.js file is needed to run this example, but I had to break it into three parts because of the download limitations.

Attached Images
File Type: jpg firefoxcubegrid.jpg (79.2 KB)
Attached Files
File Type: html olap_view_test.html (29.7 KB)
File Type: js listDataTest_2(3).js (35.0 KB)
File Type: js listDataTest_1(3).js (35.0 KB)
File Type: js listDataTest_3(3).js (3.2 KB)

column does not redraw correctly when removing member

$
0
0
SmartClient v91p_2013-12-19
IE9
Chrome 30
Firefox 20

If I right click in a column header and use the context menu to remove the first measure in my example, Last Value, the grid behaves as expected. It removes the column and redraws the other columns correctly, showing all their values. If I use the menu button in the column header and remove the first measure that way, the grid does not behave as expected. It removes the first column, but the values for the new first column are left blank. If I remove the new first column, then it shows two columns and the first is blank, and so on. Why do we get different behavior in these two cases?

Thanks

Attached Images
File Type: jpg cubegridcolumnblanks.jpg (90.4 KB)
Attached Files
File Type: js listDataTest_1(3).js (35.0 KB)
File Type: js listDataTest_2(3).js (35.0 KB)
File Type: js listDataTest_3(3).js (3.2 KB)
File Type: html olap_view_test.html (29.7 KB)

Accessibility Issues

$
0
0
We have enabled SC.setScreenReaderMode(true) but still encountering the following issues:

1- Elements with ARIA roles must use a valid, non-abstract ARIA role. please see the attached image. How can we get rid of it? This code is generated by SmartGWT

2- some of the images are being appended by SmartGWT and has no alt attribute. it causes a warning. is it possible to get rid of it?

3- part of our accessibility requirement is to wrap all <form> tags inside the <fieldset> tags. our application has extensively used the form and practically its not possible to change each and every instance of it. is it possible to make this change at one place which wrap the form inside the fieldset?

Please kindly reply ASAP

Thanking you in advance

Attached Images
File Type: png accessibility.png (68.1 KB)

ListGrid Checkbox Header Controls?

$
0
0
With an explicit ListGridField, I can set a header icon by ListGridField.setIcon("MyImage.png");

Is it possible to achieve a similar result for the implicit column generated by ListGrid.setSelectionAppearance(SelectionAppearanc e.CHECKBOX); ?

How can I access the selection checkbox column header?

Even though the Grid will allow multiple selection, I do not want a "Select All" checkbox in the column header. Instead, I want a replacement image with no functionality.

ListGrid select on filter change

$
0
0
I have 2 ListGrids: top and bottom. The bottom grid gets filtered based on what is selected in the top grid. I did this by adding a SelectionUpdatedHandler to top that calls bottom.filterData with a criteria based on the selection. So when the user clicks on an item with a certain Category, only those matching in bottom will be displayed.

Now, I'm trying to do the reverse: to select an item in top when the user filters using the filter editor for a specific field. For example, in the filter editor for the bottom grid's Category field, the user types 1. This should cause the bottom grid to display only items with Category 1. I also want the item with Category 1 to be selected in the top grid.

I tried adding a FilterSubmitHandler that calls selectRecord on the top grid that matches the filter. However, this also invokes the SelectionUpdatedHandler added to top. Is there a way to tell the difference between when the user clicked a checkbox to select verses when it's done programmatically?

How to force TimelineWindow (EventWindow) to show close button in Timeline ?

$
0
0
I'm testing smartgwt 4.1

How can I override default behaviour of TimelineWindow to DO show close button ?

Thanks in advance for your reply

CanvasItem showValue ?

$
0
0
I am trying to use a CanvasItem to be used on a form. I see the docs say to implement showValue if you want the data to be set within this CanvasItem, but where is the showValue method that I should override?

"If you set shouldSaveValue:true, CanvasItem.showValue will be called to provide a value that your item should display. Implement showValue() and call methods on the Canvas you've created to cause the value to be displayed."

Is there a simple example for this somewhere?

Calendar Strings from DateItem - added translations

$
0
0
As in title - i've added polish days, months and abbreviations translations in the getLocalization...

Please include them in nightly build, because at this moment, the calendar is unreadable in polish :)

Arbitrary boolean condition in Hilite setCriteria

$
0
0
Hi Isomorphic,

I saw the example http://www.smartclient.com/smartgwt/...ng_pre_defined and wanted to ask if the following is possible:
Replace some of the conditions in
Code:

setCriteria(new AdvancedCriteria(OperatorId.AND, new Criterion[] { 
        new Criterion("gdp", OperatorId.GREATER_THAN, 1000000), 
        new Criterion("area", OperatorId.LESS_THAN, 500000)}));

with methods returning a boolean value. I have a method boolean User.mayEdit(Record r, ...) and would like to use it here.
Criterion does not have a constructor that takes a constant as 1st value, otherwise I could solve it using
Code:

...
new Criterion(true, OperatorId.EQUALS, User.mayEdit(Record r, ...))

Is there some workaround (other than defining a fake field always returning true in my .ds.xml) to do this?

Thank you & Best regards,
Blama

isc_css3Mode=off and PickTrees

$
0
0
SmartGWT: smartgwt-4.0p-2014-01-08

With
Code:

isc_css3Mode="off"
a PickTree is drawn without any borders. This happens with any browser.

Is there any way to get back the borders without css3?

Code:

@Override
    public void onModuleLoad() {
        final DynamicForm form = new DynamicForm();
        form.setWidth(300);

        Tree tree = new Tree();
        tree.setRoot(departmentRoot);

        IPickTreeItem departmentItem = new IPickTreeItem();
        departmentItem.setTitle("Department");
        departmentItem.setValueField("name");
        departmentItem.setValueTree(tree);

        form.setItems(departmentItem);

        form.draw();
    }

private static final TreeNode departmentRoot =
            new DepartmentTreeNode("root",
                    new DepartmentTreeNode("Marketing",
                            new DepartmentTreeNode("Advertising"),
                            new DepartmentTreeNode("Community Relations")),
                    new DepartmentTreeNode("Sales",
                            new DepartmentTreeNode("Channel Sales"),
                            new DepartmentTreeNode("Direct Sales")),
                    new DepartmentTreeNode("Manufacturing",
                            new DepartmentTreeNode("Design"),
                            new DepartmentTreeNode("Development"),
                            new DepartmentTreeNode("QA")),
                    new DepartmentTreeNode("Services",
                            new DepartmentTreeNode("Support"),
                            new DepartmentTreeNode("Consulting")));

    public static class DepartmentTreeNode extends TreeNode {
        public DepartmentTreeNode(String name) {
            setName(name);
        }

        public DepartmentTreeNode(String name, DepartmentTreeNode... children) {
            setName(name);
            setChildren(children);
        }
    }

GWT Plugin is not installing in Google Chrome Browser

$
0
0
Hi,
I am not able to add "GWT Plugin" to the Google Chrome Browser.
I have faced an error like "TUNNEL CONNECTION FAILED" while adding the Gwt Plugin to Chrome browser.
Please find the attached screenshot.
Please give me solution for this issue.


Thanks

Attached Images
File Type: png GWT_PLUGIN_FAIL_IMG.png (25.6 KB)

Event drag problem.

$
0
0
Hi,

In calendar day view if event moving to another cell, then change view to week view its day also changing. It turn back to true day after refresh.

It can be tested via showcase.

test stages:
I have dragged an event to 1:00 pm on day view before.
I have changed view to week view after.
Then i am dragged event has dropped to 1:00 pm first day of week.

Thanks.

VelocityException: Error initializing log

$
0
0
We are occassionally having some trouble, with major impact, starting up the application in the browser. The issue vanishes after restarting the server (IBM WSphere). Is this a known issue? Feedback would be much appreciated.


SmartClient Version: v9.0p_2013-09-22/PowerEdition Deployment (built 2013-09-22)

2. IE 9, Version: 9.0.8112.16421


Code:

[1/10/14 15:01:52:690 CET] 00000057 SystemOut    O - dsRequest.execute() failed: 
org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.SimpleLog4JLogSystem with the current runtime configuration.       
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:875)       
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262)       
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)       
at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)       
at com.isomorphic.velocity.Velocity.getEngine(Velocity.java:84)       
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:321)       
at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)       
at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2427)       
at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:215)       
at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:172)       
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:137)       
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)       
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)       
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)       
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)       
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1225)       
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775)       
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457)       
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)       
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)       
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)       
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)       
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)       
at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:246)       
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)       
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)       
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)       
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)       
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3763)       
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)       
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975)       
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)       
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)       
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)       
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)       
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)       
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)       
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)       
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:166)       
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)       
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)       
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1691)

Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.SimpleLog4JLogSystem with the current runtime configuration.       
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:220)       
at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269)       
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871)       
... 43 more

Caused by: java.lang.ClassCastException: java.util.Vector incompatible with java.lang.String        at org.apache.velocity.runtime.log.SimpleLog4JLogSystem.init(SimpleLog4JLogSystem.java:70)       
at org.apache.velocity.runtime.log.LogChuteSystem.init(LogChuteSystem.java:53)       
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:166)       
... 45 more


Have by now tried to configure the log settings, but the com.isomorphic.velocity.Velocity class seems to be looking for the SimpleLog4JLogSystem class!

Code:

final VelocityEngine ve = new VelocityEngine();
ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, Log4JLogChute.class.getName());
ve.setProperty("runtime.log.logsystem.log4j.category", "velocity");
ve.init();

UPDATE:
Looking at the source of com.isomorphic.datasource.DataSourceDMI.java and com.isomorphic.velocity.Velocity.java, it seems like the properties used to initialise the apache VelocityEngine is hardcoded and the engine is retrieved via static definitions, preventing us to overwrite the definition. Any possible workarounds?

Code:

public class DataSourceDMI
    implements IScriptSource, FreeResourcesHandler
{
...
    public DSResponse execute() throws Exception
    {
        ...
            VelocityEngine vEngine = Velocity.getEngine();
        ...
    }

    protected VelocityEngine getVelocityEngine()
        throws Exception
    {
        VelocityEngine vEngine = new VelocityEngine();
        Properties properties = new Properties();
        properties.put("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
        properties.put("runtime.log.logsystem.log4j.category", "org.apache.Velocity");
        vEngine.init(properties);
        return vEngine;
    }
...
}

Code:

public class Velocity extends Base
{

    public Velocity()
    {
    }

    public static VelocityEngine getEngine()
        throws Exception
    {
        if(vEngine != null)
        {
            return vEngine;
        } else
        {
            vEngine = new VelocityEngine();
            Properties properties = new Properties();
            properties.put("file.resource.loader.path", "");
            properties.put("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
            properties.put("runtime.log.logsystem.log4j.category", "org.apache.Velocity");
            vEngine.init(properties);
            return vEngine;
        }
    }
....
}

SQLDataSource beans

$
0
0
Here is a simple question:

Our server side code uses the following Entity Objects to encapsulate a set of data

That should be sufficient detail to understand where the data model is headed.

Your documentation clearly states that we should prefer SQL over JPA DataSources. It also states that DataSources can return beans.
I have tried at great length to create a pojo that models the server side implementation, and to get an SQLDataSource to effectively return that bean as a DSResponse. Declaring that bean to be a schemaBean however blows up as there is no column in the table with the name cdl, sortie, etc. Declaring that bean using beanClassName results in a successful fetch however the data returned is flat much like the resulting table from using Embeddables. So I thought perhaps I could use valueXPath to define the mapping of fields to bean setters and getters, but then it complains that the returned object has no such objects and methods.

So I am wondering, am I missing something in configuration, or are my expectations not in alignment with what an SQLDataSource can really do? I have poured over the documentation and samples and do not see anything that either confirms or denies this is capable, neither any example that illustrates such an idea. Am I actually expected to use a JPA2DataSource in this implementation? If you would like I can provide all entity and embeddables, along with ds.xml and bean classes. But for expediency at the end of the day, and an expectation that you are going to tell me that this is not possible I will forgo providing them at this moment.

Thanks for you explanation in advance :)
Viewing all 4756 articles
Browse latest View live