Announcement

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

    Controlling fields width in FilterBuilder using SmartGWT

    Hi,
    I need to manually override the default fields width in FilterBuilder, but I have found only a partial solution.
    For the field name picker I've found the setFieldPickerProperties method
    Code:
    final FormItem fieldPicker = new SelectItem ();
    fieldPicker.setWidth (200);
    filterBuilder.setFieldPickerProperties (fieldPicker);
    but I still can't change the width of the remaining widgets (operator, value and so on) cause I've not found the setFieldPickerProperties counterpart.

    I saw a similar request for SmartClient:
    http://forums.smartclient.com/showthread.php?t=6425
    How can I do the same using SmartGWT?
    Should I use JSNI?

    At client side I'm using
    SmartClient Version: SC_SNAPSHOT-2010-10-11/LGPL Development Only (built 2010-10-11)
    GWT 2.0.4
    Firefox 3.6.10


    Kind regards
    Davide
    Last edited by d.cavestro; 18 Oct 2010, 02:23.

    #2
    Any idea?
    Isomorphic?

    Comment


      #3
      Isomorphic? davidj6?

      Comment


        #4
        Isomorphic?
        Sorry for stressing on this... but I'd like to know if this is a silly request or it was simply left out?

        Comment


          #5
          You can use JSNI to get to the SmartClient APIs, which are currently a bit richer - more AutoChildren are exposed for customization.

          To get reliable response times, please purchase a commercial support plan.

          Comment


            #6
            Originally posted by Isomorphic
            You can use JSNI to get to the SmartClient APIs, which are currently a bit richer - more AutoChildren are exposed for customization.

            To get reliable response times, please purchase a commercial support plan.
            Many thanks

            About the support, I'll certainly discuss about this with my principal (I'm just coming out from some kind of experiment on which I personally bet on this technology...).

            Comment


              #7
              Solved

              Originally posted by Isomorphic
              You can use JSNI to get to the SmartClient APIs, which are currently a bit richer - more AutoChildren are exposed for customization.
              For the sake of other users facing the problem of changing defaults for autochild elements using SmartGWT, here you are the way I solved it using JSNI

              Code:
              private native void adaptFilterBuilderDefaults () /*-{
                //set width for the top operator picker
                $wnd.isc.FilterBuilder.changeDefaults("topOperatorFormDefaults", {
                  width: 60
                });
                //set widths for field picker, operator picker and value item
                $wnd.isc.FilterClause.addProperties ({
                  fieldPickerWidth: 100,
                  operatorPickerWidth: 120,
                  valueItemWidth: 200
                });
              }-*/;
              I simply call this method during the EntryPoint initialization phase.

              I've also learnt in these cases can be useful not only peeking into the SmartClient Developer Console's Watch tab, but also to directly examinate the sources from SmartClient library distribution.

              Cheers
              Davide
              Last edited by d.cavestro; 23 Dec 2010, 07:00.

              Comment


                #8
                I know this is a very old thread but it doesn't seem to work any more

                I am attempting to use this methodology to change the field picker with in SmartGWT 4.0 and it doesn't seem to work any longer... at least in Dev Mode.

                Is this no longer the way to change the width? Is there a way at all now?

                Thanks

                Comment

                Working...
                X