Announcement

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

  • Like GWT ListBox.setVisibleItemCount(), Is there any API available in SmartGWT

    To set number of visible Items in GWT ListBox we have ListBox.setVisibleItemCount() API but I didn't find any way to achieve the same in SmartGWT's SelectItem. My requirement is to display an image and text in SelectItem list and like in GWT we should be able to display multiple items at a time.

    There is an option to set mutiselect using selectItem.setMultiple(true); and selectItem.setMultipleAppearance(MultipleAppearance.GRID); but if we set multiselect in this way, image is not displaying in the list box only text is coming and i am seeing error piling up in devmode console when i click on the SelectItem.

    I am not getting whether displaying multiple items is possible in SmartGWT's SelectItem (with image) or not, or Am i missing something here.

    My requirement is - I need a Single selection ListBox where i can add image, text and color.
    Is this achievable using SelectItem of SmartGWT or is there any other widget i can use.

    Cam i set Height to 'SelectItem' when setMultiple is false. At least this should solve my problem.
    Last edited by madhusudhan.brm; 6th Aug 2018, 04:44.

  • #2
    You are talking several different interfaces at once in a way that is unclear..

    Do you want a single or multi-select?

    Do you want a drop-down, or a list which is always visible?

    Comment


    • #3
      I found out that ListGrid is the best suite for our project requirement so we are using ListGrid now instead of ListBox. But I am facing a different issue now that is,
      I am trying to write JUnit for a new form and I have used ListGrid in this form. But when I run JUnit for this form I am getting the following error. I am facing this issue only at the time of running JUnit, other than that it is working completely fine.

      java.lang.RuntimeException: Remote test failed at 10.120.15.15 / Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19 at com.google.gwt.junit.JUnitShell.processTestResult(JUnitShell.java:1288) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1408) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309) at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653) at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.Exception: java.lang.ExceptionInInitializerError at com.verifone.isd.psc.config.client.pres.view.widgets.SMSListGrid.<init>(SMSListGrid.java:15) at com.verifone.isd.psc.config.client.pres.view.widgets.FormElementType$29.buildWidget(FormElementType.java:219) at com.verifone.isd.psc.config.client.pres.view.widgets.FormElementType$29.buildWidget(FormElementType.java:1) at com.verifone.isd.psc.config.client.pres.view.widgets.SMSWidgetFactory.build(SMSWidgetFactory.java:74) at com.verifone.isd.psc.config.client.pres.controller.TabBuilder.buildWidgets(TabBuilder.java:114) at com.verifone.isd.psc.config.client.pres.controller.TabBuilder.process(TabBuilder.java:60) at com.verifone.isd.psc.config.client.pres.common.ImplTestBase.buildTabs(ImplTestBase.java:201) at com.verifone.isd.psc.config.client.pres.common.ImplTestBase.initialize(ImplTestBase.java:134) at com.verifone.isd.psc.config.client.pres.common.ImplTestBase.gwtSetUp(ImplTestBase.java:66) at com.google.gwt.junit.client.GWTTestCase.setUp(GWTTestCase.java:255) at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:187) at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:129) at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:389) at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:318) at com.google.gwt.junit.client.impl.GWTRunner.access$9(GWTRunner.java:312) at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:107) at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:63) at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:1) at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) 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.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:220) 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.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.Exception: com.google.gwt.core.client.JavaScriptException: (null): null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.BaseWidget.init(BaseWidget.java) at com.smartgwt.client.widgets.BaseWidget.<clinit>(BaseWidget.java:52) ... 47 more


      Please suggest why it is failing to create ListGrid.

      Thanks.

      Comment

      Working...
      X