Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    classcast exception: java.lang.ClassCastException: java.util.ArrayList cannot be cast

    smartgwtee-4.0p

    Hi,
    I am trying to do a simple prototype of generating an image on the server and displaying it on a listgrid using DMI. I adapted what I found on the forum as follows:

    ds.xml:

    <DataSource
    ID="testDMI"
    serverType="generic"

    >
    <fields>


    <field name="imageTest" title="Test image" type="imageFile" required="false" showFileInline="true">
    </field>
    </fields>

    <serverObject lookupStyle="new" className="com.smartgwt.sample.server.TestDMI"/>


    <!-- You can define an operationBindings section to bind operation names to server method
    (potentially additionally discriminated by the operationId).
    In the absense of this section, the server will look for a server method named after
    the operationType.
    -->
    <serverObject lookupStyle="new" className="com.smartgwt.sample.server.TestDMI" />
    <operationBindings>
    <binding operationType="viewFile" serverMethod="viewFile">
    <serverObject lookupStyle="new" className="com.smartgwt.sample.server.TestDMI" />
    </binding>
    </operationBindings>
    <operationBindings>
    <binding operationType="fetch" serverMethod="fetch">
    <serverObject lookupStyle="new" className="com.smartgwt.sample.server.TestDMI"/>
    </binding>
    </operationBindings>

    </DataSource>

    TestDMI:

    public class TestDMI {
    List<Map<String,Object>> imageData = new ArrayList<Map<String, Object>>();
    InputStream imageStream = null;
    public DSResponse fetch(DSRequest dsRequest)
    throws Exception
    {
    Logger log = new Logger(TestDMI.class.getName());


    File file = new File(dsRequest.getServletContext().getRealPath("/images/pdda1.png"));

    imageStream = new BufferedInputStream( new FileInputStream(file) );

    HashMap<String, Object> hm = new HashMap<String, Object>();
    //hm.put("image", imageStream);
    hm.put("imageTest_filename", file.getName());
    hm.put("imageTest_filesize", file.length());
    imageData.add(hm);

    DSResponse response = new DSResponse();
    response.setDataSource(dsRequest.getDataSource());
    response.setSuccess();
    response.setTotalRows(1);
    response.setData(imageData);
    response.setStartRow(0);
    response.setEndRow(1);


    response.setData(imageData);

    return response;


    }

    public DSResponse viewFile(DSRequest dsRequest, RPCManager rpcManager) throws Exception {

    File file = new File(dsRequest.getServletContext().getRealPath("/images/pdda1.png"));


    imageStream = new BufferedInputStream( new FileInputStream(file) );

    HashMap<String, Object> hm = new HashMap<String, Object>();
    hm.put("imageTest", imageStream);
    hm.put("imageTest_filename", file.getName());
    hm.put("imageTest_filesize", file.length());

    imageData.add(hm);

    DSResponse response = new DSResponse();
    response.setDataSource(dsRequest.getDataSource());
    response.setSuccess();
    response.setTotalRows(1);
    response.setStartRow(0);
    response.setEndRow(1);


    response.setData(imageData);


    return response;
    }

    }

    client:

    @Override
    public void onModuleLoad() {
    DataSource dataSource = DataSource.get("testDMI");

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

    final ListGrid boundList = new ListGrid();
    boundList.setDataSource(dataSource);
    boundList.setHeight(200);
    boundList.setCanEdit(true);
    boundList.fetchData();
    vStack.addMember(boundList);

    vStack.draw();

    }

    We get the following exception:

    WARN] Server class 'org.apache.commons.codec.net.URLCodec' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/D:/smartgwt2/smartgwtee-4.0p/lib/commons-codec-1.3.jar' to the web app classpath for this session
    For additional info see: file:/C:/Program%20Files/IBM/SDPShared/plugins/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/doc/helpInfo/webAppClassPath.html
    === 2013-10-15 09:14:11,989 [l0-4] DEBUG XML - Parsed XML from (in memory stream): 0ms
    === 2013-10-15 09:14:11,989 [l0-4] DEBUG XML - Parsed XML from D:\rad8workspaces\rgalc-smartgwt\builtinds\war\builtinds\sc\system\schema\List.ds.xml: 0ms
    === 2013-10-15 09:14:11,989 [l0-4] DEBUG RPCManager - Processing 1 requests.
    === 2013-10-15 09:14:12,005 [l0-4] DEBUG DSRequest - Caching instance 10 of DS testDMI from DSRequest.getDataSource()
    === 2013-10-15 09:14:12,005 [l0-4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
    criteria:{
    },
    operationConfig:{
    dataSource:"testDMI",
    operationType:"fetch",
    textMatchStyle:"exact"
    },
    startRow:0,
    endRow:75,
    componentId:"isc_ListGrid_0",
    appID:"builtinApplication",
    operation:"testDMI_fetch",
    oldValues:{
    }
    }
    === 2013-10-15 09:14:12,005 [l0-4] INFO IDACall - Performing 1 operation(s)
    === 2013-10-15 09:14:12,005 [l0-4] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2013-10-15 09:14:12,005 [l0-4] DEBUG DeclarativeSecurity - DataSource testDMI is not in the pre-checked list, processing...
    === 2013-10-15 09:14:12,020 [l0-4] WARN RequestContext - dsRequest.execute() failed:
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
    at com.isomorphic.datasource.DataSource.getServerObjectConfig(DataSource.java:715)
    at com.isomorphic.datasource.DataSourceDMI.validateOperationBinding(DataSourceDMI.java:497)
    at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:149)
    at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
    at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2408)
    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:637)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
    === 2013-10-15 09:14:12,020 [l0-4] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2013-10-15 09:14:12,020 [l0-4] DEBUG RPCManager - non-DMI response, dropExtraFields: false

    Please advise.

    #2
    SHere are the logs. The only thing changed from the last post is a tilegrid replacing the listgrid on the client.

    11:06:36.198:INFO:Log:initialized
    11:06:39.646:WARN:Log:WARNING: due to bugs in Chrome, GWT development mode in Chrome is not reliable and should not be used. This does not affect compiled mode in Chrome, which works. Note that the same bug makes GWT development mode in Chrome very slow as well, so other browsers will be faster as well. More details including links to Chrome bugs here: http://forums.smartclient.com/showthread.php?t=8159#aChrome
    11:06:39.926:DEBUG:RPCManager:Grabbed prompt from first request that defined one: Finding Records that match your criteria...
    11:06:39.962:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0]: 859w
    11:06:39.976:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 859
    11:06:39.978:INFO:layout:isc_VStack_0:layoutChildren (reason: initial draw):
    layout specified size: 859w x 20h
    drawn size: 859w x 100h
    available size: 859w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    859 drawn breadth (breadth policy: fill)

    11:06:40.014:INFO:Log:isc.Page is loaded
    11:06:40.045:INFO:RPCManager:Resubmitting transaction number: 0
    11:06:40.059:INFO:RPCManager:sendQueue[0]: 1 RPCRequest(s); transport: xmlHttpRequest; target: http://127.0.0.1:8888/builtinds/sc/IDACall?isc_rpc=1&isc_v=v9.0p_2013-07-15&isc_xhr=1
    11:06:40.075:DEBUG:RPCManager:XMLHttpRequest POST to http://127.0.0.1:8888/builtinds/sc/IDACall?isc_rpc=1&isc_v=v9.0p_2013-07-15&isc_xhr=1 contentType: application/x-www-form-urlencoded; charset=UTF-8 with body -->isc_tnum=0&_transaction=<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">0</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"></criteria><operationConfig xsi:type="xsd:Object"><dataSource>testDMI</dataSource><operationType>fetch</operationType><textMatchStyle>exact</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">75</endRow><componentId>isc_TileGrid_0</componentId><appID>builtinApplication</appID><operation>testDMI_fetch</operation><oldValues xsi:type="xsd:Object"></oldValues></elem></operations></transaction>&protocolVersion=1.0<--
    11:06:40.173:TMR8[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    11:06:40.174:TMR8[E]:INFO:layout:isc_VStack_0:Restacking, reason: pageResize
    11:06:40.175:TMR8[E]:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 859
    11:06:40.234:TMR2:INFO:layout:isc_globalWarn:adding newMembers: [HLayout ID:isc_globalWarn_header]
    11:06:40.235:TMR2:DEBUG:layout:isc_globalWarn:resizing [HLayout ID:isc_globalWarn_header]: 350w
    11:06:40.251:TMR2:INFO:layout:isc_globalWarn_header:adding newMembers: [StatefulCanvas ID:isc_globalWarn_headerLabelParent]
    11:06:40.253:TMR2:DEBUG:layout:isc_globalWarn_header:resizing [StatefulCanvas ID:isc_globalWarn_headerLabelParent]: 20h
    11:06:40.259:TMR2:INFO:layout:isc_globalWarn_header:adding newMembers: [ImgButton ID:isc_globalWarn_closeButton]
    11:06:40.265:TMR2:INFO:layout:isc_globalWarn:adding newMembers: [Layout ID:isc_globalWarn_body]
    11:06:40.266:TMR2:DEBUG:layout:isc_globalWarn:resizing [Layout ID:isc_globalWarn_body]: 350w
    11:06:40.269:TMR2:INFO:layout:isc_globalWarn_body:adding newMembers: [HStack ID:isc_globalWarn_messageStack]
    11:06:40.270:TMR2:DEBUG:layout:isc_globalWarn_body:resizing [HStack ID:isc_globalWarn_messageStack]: 318w
    11:06:40.274:TMR2:INFO:layout:isc_globalWarn_messageStack:adding newMembers: [Img ID:isc_globalWarn_messageIcon]
    11:06:40.279:TMR2:INFO:layout:isc_globalWarn_messageStack:adding newMembers: [Label ID:isc_globalWarn_messageLabel]
    11:06:40.280:TMR2:DEBUG:layout:isc_globalWarn_messageStack:resizing [Label ID:isc_globalWarn_messageLabel]: 1h
    11:06:40.285:TMR2:INFO:layout:isc_globalWarn_body:adding newMembers: [Toolbar ID:isc_globalWarn_toolbar]
    11:06:40.327:TMR2:DEBUG:layout:isc_globalWarn_messageStack:centering wrt visible breadth: 32
    11:06:40.330:TMR2:INFO:layout:isc_globalWarn_messageStack:layoutChildren (reason: initial draw):
    layout specified size: 318w x 1h
    drawn size: 380w x 47h
    available size: 318w (length) x 1h
    [Img ID:isc_globalWarn_messageIcon]
    32 drawn length (policyLength: 32) (no length policy)
    32 drawn breadth (explicit size)
    [Label ID:isc_globalWarn_messageLabel]
    318 drawn length (policyLength: 318) (no length policy)
    1 drawn breadth (breadth policy: fill)

    11:06:40.338:TMR2:INFO:layout:isc_globalWarn_toolbar:adding newMembers: [IButton ID:isc_IButton_0] at position: 0
    11:06:40.339:TMR2:DEBUG:layout:isc_globalWarn_toolbar:resizing [IButton ID:isc_IButton_0]: 22h
    11:06:40.349:TMR2:DEBUG:layout:isc_globalWarn_toolbar:centering wrt visible breadth: 22
    11:06:40.351:TMR2:INFO:layout:isc_globalWarn_toolbar:layoutChildren (reason: initial draw):
    layout specified size: 20w x 42h
    drawn size: 95w x 42h
    available size: 20w (length) x 42h
    [IButton ID:isc_IButton_0]
    75 drawn length (resizeLength: 75) (policyLength: 75) (explicit size)
    22 drawn breadth (breadth policy: fill)

    11:06:40.358:TMR2:DEBUG:layout:isc_globalWarn_body:centering wrt visible breadth: 380
    11:06:40.359:TMR2:INFO:layout:isc_globalWarn_body:layoutChildren (reason: initial draw):
    layout specified size: 350w x 50h
    drawn size: 412w x 111h
    available size: 348w x 48h (length)
    [HStack ID:isc_globalWarn_messageStack]
    47 drawn length (policyLength: 47) (no length policy)
    318 drawn breadth (breadth policy: fill)
    [Toolbar ID:isc_globalWarn_toolbar]
    42 drawn length (policyLength: 42) (no length policy)
    95 drawn breadth (explicit size)

    11:06:40.361:TMR2:INFO:layout:isc_globalWarn:edgeWidth is: 10, setting window width to: 422
    11:06:40.362:TMR2:DEBUG:layout:isc_globalWarn:new user width: 412 for member [HLayout ID:isc_globalWarn_header], oldSize: 100% reason: undefined
    11:06:40.368:TMR2:DEBUG:layout:isc_globalWarn_header:resizing [StatefulCanvas ID:isc_globalWarn_headerLabelParent]: 20h 395w
    11:06:40.389:TMR2:DEBUG:layout:isc_HStack_0:centering wrt visible breadth: 20
    11:06:40.391:TMR2:INFO:layout:isc_HStack_0:layoutChildren (reason: initial draw):
    layout specified size: 395w x 20h
    drawn size: 395w x 20h
    available size: 395w (length) x 20h
    [Label ID:isc_globalWarn_headerLabel]
    29 drawn length (policyLength: 29) (no length policy)
    20 drawn breadth (breadth policy: fill)

    11:06:40.400:TMR2:DEBUG:layout:isc_globalWarn_header:centering wrt visible breadth: 20
    11:06:40.402:TMR2:INFO:layout:isc_globalWarn_header:layoutChildren (reason: initial draw):
    layout specified size: 412w x 20h
    drawn size: 412w x 20h
    available size: 412w (length) x 20h
    [StatefulCanvas ID:isc_globalWarn_headerLabelParent]
    395 drawn length (resizeLength: 395) (policyLength: *) (no length specified)
    20 drawn breadth (breadth policy: fill)
    [ImgButton ID:isc_globalWarn_closeButton]
    15 drawn length (resizeLength: 15) (policyLength: 15) (explicit size)
    15 drawn breadth (explicit size)

    11:06:40.403:TMR2:DEBUG:layout:isc_globalWarn:centering wrt visible breadth: 412
    11:06:40.405:TMR2:INFO:layout:isc_globalWarn:layoutChildren (reason: initial draw):
    layout specified size: 422w x 60h
    drawn size: 422w x 138h
    available size: 420w x 58h (length)
    [HLayout ID:isc_globalWarn_header]
    20 drawn length (policyLength: 20) (no length policy)
    412 drawn breadth (explicit size)
    [Layout ID:isc_globalWarn_body]
    111 drawn length (policyLength: 111) (no length policy)
    412 drawn breadth (explicit size)

    11:06:40.489:XRP5:INFO:RPCManager:transaction 0 arrived after 414ms
    11:06:40.491:XRP5:DEBUG:RPCManager:Result string for transaction 0: "//isc_RPCResponseStart-->[{data:"java.util.ArrayList cannot be cast to java.util.Map",invalidateCache:false,isDSResponse:true,queueStatus:-1,status:-1}]//isc_RPCResponseEnd"
    11:06:40.493:XRP5:INFO:RPCManager:rpcResponse(testDMI_fetch)[fetch]: result: object[status=-1]
    11:06:40.513:XRP5:INFO:layout:isc_globalWarn_toolbar:adding newMembers: [IButton ID:isc_IButton_0] at position: 0
    11:06:40.514:XRP5:DEBUG:layout:isc_globalWarn_toolbar:resizing [IButton ID:isc_IButton_0]: 22h
    11:06:40.518:XRP5:INFO:redraws:isc_globalWarn_headerLabel:Scheduling redraw (setContents)
    11:06:40.521:XRP5:INFO:redraws:isc_globalWarn_messageLabel:Scheduling redraw (setContents)
    11:06:40.527:XRP5:DEBUG:layout:isc_globalWarn_toolbar:centering wrt visible breadth: 22
    11:06:40.528:XRP5:INFO:layout:isc_globalWarn_toolbar:layoutChildren (reason: undefined):
    layout specified size: 20w x 42h
    drawn size: 95w x 42h
    available size: 20w (length) x 42h
    [IButton ID:isc_IButton_0]
    75 drawn length (resizeLength: 75) (policyLength: 75) (explicit size)
    22 drawn breadth (breadth policy: fill)

    11:06:40.570:XRP5:INFO:redraws:isc_globalWarn_messageLabel:Immediate redraw of dirty widget (no reason provided)
    [a]MathFunction.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef, _5=>undef)
    Canvas.$q9(_1=>undef, _2=>false)
    Canvas.redraw(_1=>undef)
    [a]Dialog.showMessage(_1=>"java.util.ArrayList cannot be cast to ja..."[51], _2=>Obj{title:Warning})
    anonymous(_1=>"java.util.ArrayList cannot be cast to ja..."[51], _2=>"warn", _3=>undef, _4=>Obj{title:Warning})
    anonymous(_1=>"java.util.ArrayList cannot be cast to ja..."[51], _2=>undef, _3=>undef)
    [c]RPCManager.reportError(_1=>"java.util.ArrayList cannot be cast to ja..."[51])
    [c]RPCManager.handleError(_1=>Obj, _2=>Obj)
    [c]RPCManager.$a0(_1=>Obj, _2=>Obj)
    ResultSet.fetchRemoteDataReply(dsResponse=>Obj, data=>"java.util.ArrayList cannot be cast to ja..."[51], request=>Obj)
    [c]Class.fireCallback(_1=>Obj, _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>[ResultSet ID:isc_ResultSet_0 (created by: isc_TileGrid_0)], _5=>undef) on [Class DataSource]
    [a]MathFunction.fireCallback(_1=>Obj, _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>undef)
    DataSource.fireResponseCallbacks(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Obj)
    DataSource.$38b(_1=>"java.util.ArrayList cannot be cast to ja..."[51], _2=>Obj, _3=>Obj, _4=>Obj, _5=>Obj)
    DataSource.$50h(_1=>Obj, _2=>"java.util.ArrayList cannot be cast to ja..."[51], _3=>Obj)
    ** recursed on [c]Class.fireCallback

    11:06:40.575:XRP5:INFO:layout:isc_globalWarn_messageStack:Restacking, reason: undefined
    11:06:40.576:XRP5:DEBUG:layout:isc_globalWarn_messageStack:centering wrt visible breadth: 32
    11:06:40.580:XRP5:INFO:layout:isc_globalWarn_body:Restacking, reason: undefined
    11:06:40.580:XRP5:DEBUG:layout:isc_globalWarn_body:centering wrt visible breadth: 380
    11:06:40.582:XRP5:INFO:layout:isc_globalWarn:edgeWidth is: 10, setting window width to: 422
    11:06:40.582:XRP5:INFO:layout:isc_globalWarn:Restacking, reason: undefined
    11:06:40.583:XRP5:DEBUG:layout:isc_globalWarn:centering wrt visible breadth: 412
    11:06:40.598:XRP5:WARN:RPCManager:java.util.ArrayList cannot be cast to java.util.Mapundefined - response: {operationId: "testDMI_fetch",
    clientContext: Obj,
    context: Obj,
    transactionNum: 0,
    httpResponseCode: 200,
    httpResponseText: "//isc_RPCResponseStart-->[{data:"java.ut..."[172],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: -1,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: Obj,
    data: "java.util.ArrayList cannot be cast to ja..."[51],
    invalidateCache: false,
    isDSResponse: true,
    queueStatus: -1,
    startRow: 0,
    endRow: 0,
    totalRows: 0}
    11:06:40.613:XRP5[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous(),
    anonymous()
    ]
    11:06:40.620:TMR1:DEBUG:redraws:clearRedrawQueue: 1 redraws (2 items), 2ms
    11:06:40.623:TMR1[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    11:06:40.624:TMR1[E]:INFO:layout:isc_HStack_0:Restacking, reason: memberResized: (20,0): isc_globalWarn_headerLabel
    11:06:40.624:TMR1[E]:DEBUG:layout:isc_HStack_0:centering wrt visible breadth: 20
    11:07:49.380:MMV8:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_EH_screenSpan]
    11:07:49.521:MMV8:DEBUG:EventHandler:mousing out of [ScreenSpan ID:isc_EH_screenSpan] mousing over [Layout ID:isc_globalWarn_body]
    11:07:49.552:MMV3:DEBUG:EventHandler:mousing out of [Layout ID:isc_globalWarn_body] mousing over [ScreenSpan ID:isc_EH_screenSpan]
    11:08:12.199:MMV3:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_EH_screenSpan]
    11:08:13.450:MDN8:INFO:EventHandler:Target Canvas for event 'mousedown': [ScreenSpan ID:isc_EH_screenSpan]
    11:08:13.580:MUP1:INFO:EventHandler:Target Canvas for event 'mouseup': [ScreenSpan ID:isc_EH_screenSpan]
    11:08:13.580:MUP1:DEBUG:EventHandler:mouseUp cancelled by clickMask
    11:08:14.202:MMV7:DEBUG:EventHandler:mousing out of [ScreenSpan ID:isc_EH_screenSpan] mousing over [Layout ID:isc_globalWarn_body]
    11:08:14.315:MMV2:DEBUG:EventHandler:mousing out of [Layout ID:isc_globalWarn_body] mousing over [Toolbar ID:isc_globalWarn_toolbar]
    11:08:14.339:MMV6:DEBUG:EventHandler:mousing out of [Toolbar ID:isc_globalWarn_toolbar] mousing over [IButton ID:isc_IButton_0]
    11:08:14.612:MDN5:INFO:EventHandler:Target Canvas for event 'mousedown': [IButton ID:isc_IButton_0]
    11:08:14.619:MDN5:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[IButton ID:isc_IButton_0]' has handler: Canvas.prepareForDragging()
    11:08:14.628:MDN5:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Toolbar ID:isc_globalWarn_toolbar]' has handler: Toolbar.prepareForDragging()
    11:08:14.631:MDN5:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Layout ID:isc_globalWarn_body]' has handler: Canvas.prepareForDragging()
    11:08:14.633:MDN5:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Dialog ID:isc_globalWarn]' has handler: Canvas.prepareForDragging()
    11:08:14.633:MDN5:DEBUG:EventHandler:Event 'prepareForDragging' bubbled to top
    11:08:14.634:MDN5:DEBUG:EventHandler:Event 'mouseDown' bubbled to top
    11:08:14.634:MDN5:DEBUG:EventHandler:Event 'mouseStillDown' bubbled to top
    11:08:14.732:MUP8:INFO:EventHandler:Target Canvas for event 'mouseup': [IButton ID:isc_IButton_0]
    11:08:14.739:MUP8:DEBUG:EventHandler:Event 'mouseUp' bubbled to top
    11:08:14.762:MUP8:DEBUG:EventHandler:Event 'click' bubbled to top
    11:08:14.763:MMV0:DEBUG:EventHandler:mousing out of [IButton ID:isc_IButton_0]
    11:08:19.067:MMV6:DEBUG:EventHandler:mousing over [TileGrid ID:isc_TileGrid_0]
    11:08:19.098:MMV0:DEBUG:EventHandler:mousing out of [TileGrid ID:isc_TileGrid_0]
    11:08:21.085:TMR5:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 858w
    11:08:21.090:TMR5:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 858
    11:08:21.091:TMR5:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 858w x 20h
    drawn size: 858w x 100h
    available size: 858w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    858 drawn breadth (breadth policy: fill)

    11:08:21.128:TMR9[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    11:08:21.129:TMR9[E]:INFO:layout:isc_VStack_0:Restacking, reason: pageResize
    11:08:21.129:TMR9[E]:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 858
    11:08:21.170:TMR3:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 857w
    11:08:21.173:TMR3:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 857
    11:08:21.174:TMR3:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 857w x 20h
    drawn size: 857w x 100h
    available size: 857w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    857 drawn breadth (breadth policy: fill)

    11:08:21.217:TMR7:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 856w
    11:08:21.219:TMR7:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 856
    11:08:21.220:TMR7:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 856w x 20h
    drawn size: 856w x 100h
    available size: 856w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    856 drawn breadth (breadth policy: fill)

    11:08:21.259:TMR1:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 853w
    11:08:21.261:TMR1:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 853
    11:08:21.262:TMR1:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 853w x 20h
    drawn size: 853w x 100h
    available size: 853w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    853 drawn breadth (breadth policy: fill)

    11:08:21.303:TMR5:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 852w
    11:08:21.306:TMR5:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 852
    11:08:21.307:TMR5:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 852w x 20h
    drawn size: 852w x 100h
    available size: 852w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    852 drawn breadth (breadth policy: fill)

    11:08:21.354:TMR9:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 849w
    11:08:21.357:TMR9:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 849
    11:08:21.358:TMR9:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 849w x 20h
    drawn size: 849w x 100h
    available size: 849w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    849 drawn breadth (breadth policy: fill)

    11:08:21.391:TMR3:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 841w
    11:08:21.394:TMR3:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 841
    11:08:21.395:TMR3:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 841w x 20h
    drawn size: 841w x 100h
    available size: 841w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    841 drawn breadth (breadth policy: fill)

    11:08:21.435:TMR7:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 827w
    11:08:21.438:TMR7:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 827
    11:08:21.439:TMR7:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 827w x 20h
    drawn size: 827w x 100h
    available size: 827w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    827 drawn breadth (breadth policy: fill)

    11:08:21.481:TMR1:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 811w
    11:08:21.484:TMR1:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 811
    11:08:21.485:TMR1:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 811w x 20h
    drawn size: 811w x 100h
    available size: 811w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    811 drawn breadth (breadth policy: fill)

    11:08:21.532:TMR5:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 787w
    11:08:21.535:TMR5:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 787
    11:08:21.536:TMR5:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 787w x 20h
    drawn size: 787w x 100h
    available size: 787w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    787 drawn breadth (breadth policy: fill)

    11:08:21.575:TMR9:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 774w
    11:08:21.577:TMR9:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 774
    11:08:21.578:TMR9:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 774w x 20h
    drawn size: 774w x 100h
    available size: 774w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    774 drawn breadth (breadth policy: fill)

    11:08:21.616:TMR3:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 764w
    11:08:21.618:TMR3:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 764
    11:08:21.619:TMR3:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 764w x 20h
    drawn size: 764w x 100h
    available size: 764w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    764 drawn breadth (breadth policy: fill)

    11:08:21.667:TMR7:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 757w
    11:08:21.670:TMR7:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 757
    11:08:21.671:TMR7:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 757w x 20h
    drawn size: 757w x 100h
    available size: 757w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    757 drawn breadth (breadth policy: fill)

    11:08:21.709:TMR1:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 751w
    11:08:21.711:TMR1:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 751
    11:08:21.712:TMR1:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 751w x 20h
    drawn size: 751w x 100h
    available size: 751w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    751 drawn breadth (breadth policy: fill)

    11:08:21.744:TMR5:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 746w
    11:08:21.747:TMR5:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 746
    11:08:21.748:TMR5:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 746w x 20h
    drawn size: 746w x 100h
    available size: 746w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    746 drawn breadth (breadth policy: fill)

    11:08:21.781:TMR9:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 740w
    11:08:21.784:TMR9:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 740
    11:08:21.785:TMR9:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 740w x 20h
    drawn size: 740w x 100h
    available size: 740w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    740 drawn breadth (breadth policy: fill)

    11:08:21.817:TMR3:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 737w
    11:08:21.819:TMR3:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 737
    11:08:21.820:TMR3:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 737w x 20h
    drawn size: 737w x 100h
    available size: 737w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    737 drawn breadth (breadth policy: fill)

    11:08:21.895:TMR7:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 736w
    11:08:21.898:TMR7:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 736
    11:08:21.899:TMR7:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 736w x 20h
    drawn size: 736w x 100h
    available size: 736w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    736 drawn breadth (breadth policy: fill)

    11:08:21.953:TMR1[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    11:08:21.954:TMR1[E]:INFO:layout:isc_VStack_0:Restacking, reason: pageResize
    11:08:21.954:TMR1[E]:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 736
    11:08:21.983:TMR5:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 735w
    11:08:21.985:TMR5:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 735
    11:08:21.986:TMR5:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 735w x 20h
    drawn size: 735w x 100h
    available size: 735w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    735 drawn breadth (breadth policy: fill)

    11:08:22.008:TMR9:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 734w
    11:08:22.011:TMR9:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 734
    11:08:22.012:TMR9:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 734w x 20h
    drawn size: 734w x 100h
    available size: 734w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    734 drawn breadth (breadth policy: fill)

    11:08:22.041:TMR3[E]:DEBUG:EventHandler:firing threadExitActions: [
    anonymous()
    ]
    11:08:22.041:TMR3[E]:INFO:layout:isc_VStack_0:Restacking, reason: pageResize
    11:08:22.042:TMR3[E]:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 734
    11:08:22.065:TMR7:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 733w
    11:08:22.067:TMR7:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 733
    11:08:22.067:TMR7:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 733w x 20h
    drawn size: 733w x 100h
    available size: 733w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    733 drawn breadth (breadth policy: fill)

    11:08:22.773:MMV4:DEBUG:EventHandler:mousing over [TileGrid ID:isc_TileGrid_0]
    11:08:22.813:MMV0:DEBUG:EventHandler:mousing out of [TileGrid ID:isc_TileGrid_0]
    11:08:54.233:MMV5:DEBUG:EventHandler:mousing over [TileGrid ID:isc_TileGrid_0]
    11:08:54.327:MMV8:DEBUG:EventHandler:mousing out of [TileGrid ID:isc_TileGrid_0]
    11:09:03.796:MMV1:DEBUG:EventHandler:mousing over [TileGrid ID:isc_TileGrid_0]
    11:09:04.062:MMV4:DEBUG:EventHandler:mousing out of [TileGrid ID:isc_TileGrid_0]
    11:16:34.332:TMR4:DEBUG:layout:isc_VStack_0:resizing [TileGrid ID:isc_TileGrid_0] (drawn): 732w
    11:16:34.337:TMR4:DEBUG:layout:isc_VStack_0:centering wrt visible breadth: 732
    11:16:34.339:TMR4:INFO:layout:isc_VStack_0:layoutChildren (reason: resized):
    layout specified size: 732w x 20h
    drawn size: 732w x 100h
    available size: 732w x 20h (length)
    [TileGrid ID:isc_TileGrid_0]
    100 drawn length (policyLength: 100) (no length policy)
    732 drawn breadth (breadth policy: fill)

    11:21:38.962:MMV6:DEBUG:EventHandler:mousing over [TileGrid ID:isc_TileGrid_0]
    11:21:38.969:MMV8:DEBUG:EventHandler:mousing out of [TileGrid ID:isc_TileGrid_0]

    Comment


      #3
      The ClassCastException is happening because you have two <serverObject> tags immediately under the <DataSource> tag, which is invalid.

      But your overall approach may also be flawed - you can't send back a file inside a Record unless you base64 encode it to turn it into a string (see dataSourceField.encodeInResponse), which is probably not what you want.

      It's not clear how you want this image displayed, but if you wanted to get a URL that would work with an <img> tag or as Img.src, you would use DataSource.getFileURL(). See also the folder of Upload / Download samples in the Pro/EE Showcase.

      Comment


        #4
        Thanks. When I removed the extra serverobject tag, the image is displayed. I tried this approach based on some earlier posts. We want to display images stored in db or in the file system.

        However the image displayed is smaller than the actual image size. How do I fix that?

        thx

        Comment


          #5
          Sorry, the system is smarter than we remembered :) A grid will indeed display an imageFile automatically - it's doing so via the DataSource.getFileURL() API we recommended.

          listGridField.imageWidth and imageHeight (or imageSize as a shortcut if it's square) can be used to control the rendered size.

          Comment


            #6
            Since the grid is built from the ds.xml file based datasource, where do I specify the dimensions? in the ds.xml file? There is no way to detect the size automatically?

            Comment


              #7
              You put them on ListGridFields. See the Data Binding chapter of the QuickStart Guide if you're unclear how to use fields in combination with a .ds.xml file.

              As far as auto-sizing, this creates a tricky timing issue - rows can't be sized until the image is loaded so we know it's dimensions. But rows need to be rendered to cause the images to be fetched in the first place, unless you fetch the images separately...

              One approach: you can store the width and height as fields of the Record which has the "imageFile" field. Then, imageWidth/Height can be set to the name of a field instead of a number.

              Comment


                #8
                Hi,
                I added the following to the client code. The field name is the same as the one in ds.xml file. But the image size is still not changing. I this the approach you suggested?


                ListGridField imageField = new ListGridField("imageTest");
                imageField.setType(ListGridFieldType.IMAGEFILE);
                imageField.setImageHeight(400);
                imageField.setImageSize(400);

                Comment


                  #9
                  That's correct, and works in our testing.

                  This assumes you've set field.showFileInline:true. Otherwise you just get fixed-size view and download icons.

                  Comment


                    #10
                    This is what I have in the client:
                    ListGridField imageField = new ListGridField("imageTest");
                    imageField.setType(ListGridFieldType.IMAGEFILE);
                    imageField.setShowFileInline(true);
                    imageField.setImageWidth(400);
                    imageField.setImageHeight(400);


                    in the ds.xml:

                    <fields>


                    <field name="imageTest" title="Test image" type="imageFile" required="false" showFileInline="true">
                    </field>
                    </fields>

                    Its still not showing the size that I set. Thx

                    Comment


                      #11
                      We just triple-checked - no issue with this feature that we can see.

                      To take a guess, maybe you've configured clipping for the grid, so the image is clipped off. But if so, it would be obvious that the image is rendering at 400x400 successfully, because it would no longer appear scaled.

                      Comment


                        #12
                        The image isnt clipped. Its just scaled down. Here is the entire client code.

                        @Override
                        public void onModuleLoad() {
                        DataSource dataSource = DataSource.get("testDMI");

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

                        final ListGrid boundList = new ListGrid();
                        boundList.setDataSource(dataSource);
                        // boundList.setHeight(200);
                        // boundList.setCanEdit(true);
                        ListGridField imageField = new ListGridField("imageTest");
                        imageField.setType(ListGridFieldType.IMAGEFILE);
                        imageField.setShowFileInline(true);
                        imageField.setImageWidth(200);
                        imageField.setImageHeight(200);
                        boundList.setHeight(300);
                        boundList.setWidth(300);


                        boundList.fetchData();
                        vStack.addMember(boundList);



                        vStack.draw();

                        }

                        Comment


                          #13
                          That's a nicely configured ListGridField you've got there. Now, if you only the ListGrid knew about it..

                          (there's no call to setFields()).

                          Comment


                            #14
                            Ah, Missed that. It works now. Thanks!. I will try setting the fields for auto sizing the image.

                            Comment

                            Working...
                            X