Announcement

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

    VisualBuilder - Canvas.getById - component handle

    Hi ,

    I have created a form using VB which loads perfectly fine if I load it in java as a Canvas using Canvas.getById(formId) .

    But I want to get a handle on the form .I was told to directly use java typecast on canvas to different widgets in the forum.But,
    this is not working and gives the "ClassCastException".The Object instance coming is of Canvas and not of Dynamic form.
    Similar is the case with IButton component

    Code:
     
    
    [ERROR] Unable to load module entry point class com.sungard.gwt.client.GtmWebModule (see associated exception for details)
    java.lang.ClassCastException: com.smartgwt.client.widgets.Canvas cannot be cast to com.smartgwt.client.widgets.form.DynamicForm
    	at com.sungard.gwt.smartview.SearchPanelTest.<init>(SearchPanelTest.java:17)
    	at com.sungard.gwt.client.GtmWebModule.createTabs(GtmWebModule.java:75)
    	at com.sungard.gwt.client.GtmWebModule.onModuleLoad(GtmWebModule.java:56)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:326)
    	at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:343)
    	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$300(BrowserWidgetIE6.java:37)
    	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:77)
    	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:161)
    	at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
    	at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
    	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
    	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
    	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
    	at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:235)
    	at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:558)
    	at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
    	at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)

    Find below the js file which we are loading
    Code:
    isc.DynamicForm.create({
        numCols:4,
        dataSource:"nominationPlanSearchDataSource",
        ID:"DynamicForm3",
        autoDraw:false,
        fields:[
            {
                name:"LEGALENTITYNAME",
                ID:"LEGALENTITYNAME",
                title:"Accounting Company",
                optionDataSource:"accountingCompanyDataSource",
                _constructor:"SelectItem"
            },
            {
                name:"FACILITYNAME",
                ID:"FACILITYNAME",
                title:"Facility",
                optionDataSource:"facilityDataSource",
                _constructor:"SelectItem"
            },
            {
                name:"GRANULARITYNAME",
                ID:"GRANULARITYNAME",
                title:"Granularity",
                optionDataSource:"granularityDataSource",
                _constructor:"SelectItem"
            },
            {
                name:"FLOWRATENAME",
                ID:"FLOWRATENAME",
                title:"Flowrate",
                optionDataSource:"flowRateDataSource",
                _constructor:"SelectItem"
            },
            {name:"BEGDATE", ID:"BEGDATE", title:"Retrieve As Of Date", _constructor:"DateItem"},
            {name:"ENDDATE", ID:"ENDDATE", title:"Create through Date", _constructor:"DateItem"},
            {name:"Search", ID:"Search", align:"right", _constructor:"ButtonItem"}
        ],
        width:200,
        height:40
    })

    #2
    This is a known limitation and as a workaround you can do the following.

    Code:
    DynamicForm form = new DynamicForm(Canvas.getById(formId).getJsObj());
    We'll look into a better way to support this.

    Comment


      #3
      How can I access the Canvas from another iframe through calling Canvas.getById(id)??

      Comment

      Working...
      X