Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: SpinnerField

  1. #1

    Default SpinnerField

    I need a component acting/looking like a JSpinner in java Swing, so I made it

    Here you can find the full eclipse project :
    Real usefull things are :
    - war/css/gxt-spinner.css (must be added to you HTML page like gxt-all.css)
    - war/images/default/form/spinner_down.gif
    - war/images/default/form/spinner_up.gif
    - src/com/wcs/client/

    This version is built with GXT 2.1.0 sources, you're free to use this code. Css file and images are home made but based on existing one in GXT.

  2. #2



    Thanks for your work.
    Is it possible to post the code as an attachment here in the forum.

    Varun Tamiri

  3. #3


    Shrinked sources attached
    Attached Files Attached Files

  4. #4


    Thank you very much,
    But i'm found some errors in the file

    ensureVisibilityOnSizing =
    true; at line 99

    elseif (ce.getTarget() == input.dom) { at line 175

    el().setStyleName(readOnlyFieldStyle, readOnly); at line 243

    protected Size adjustInputSize() { at line 251

    input =
    new El(DOM.createInputText()); at line 358

    fieldStyle); at line 362

    el().appendChild(input.dom); at line 372

    ((y = input.getY()) != spinner_up.getY()) { at line 393

    The underline items are the one showing the errors

    Varun Tamiri

  5. #5


    I'm sorry but I do not understand what you mean by errors.
    It does not compile?
    The spinner is an adaptation of one of the TriggerField GXT 2.1.0, maybe I made some mistakes, feel free to correct them and explain to everyone how.

  6. #6


    i hav some problem with down arrow of the field
    it goes up some where in the page and it is not working for any fields(integer,double or disabled).
    i'm trying to upload the screenshot but i facing some issue with uploading the image so i'm compressing it and uploading.

    Thanks & Regards,
    Varun Tamiri
    Attached Files Attached Files

  7. #7


    Are you sure you have added gxt-all.css to your HTML page ?

        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <!--                                                               -->
        <!-- Consider inlining CSS to reduce the number of requested files -->
        <!--                                                               -->
        <link type="text/css" rel="stylesheet" href="Spinner.css">
        <link rel="stylesheet" type="text/css" href="css/gxt-all.css" />
        <link rel="stylesheet" type="text/css" href="css/gxt-spinner.css" />
        <!--                                           -->
        <!-- Any title is fine                         -->
        <!--                                           -->
        <title>Spinner Project</title>
        <!--                                           -->
        <!-- This script loads your compiled module.   -->
        <!-- If you add any GWT meta tags, they must   -->
        <!-- be added before this line.                -->
        <!--                                           -->
        <script type="text/javascript" language="javascript" src="spinner/spinner.nocache.js"></script>
      <!--                                           -->
      <!-- The body can have arbitrary html, or      -->
      <!-- you can leave the body empty if you want  -->
      <!-- to create a completely dynamic UI.        -->
      <!--                                           -->
        <!-- OPTIONAL: include this if you want history support -->
        <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    You should try to download the full project

  8. #8


    s I added the gxt-all.css to my html

  9. #9


    s i got when i dnld'd full project

    Varun Tamiri

  10. #10
    Sencha User
    Join Date
    Nov 2007

    Default Firing events

    Thanks for the nice component.
    It work fine in my program, however, one thing I could not get working is to respond to some of the inherited events. For example Events.Change or Events.TriggerClick.

    Here is the code sample:
        SpinnerField seqSpinner = new SpinnerField();
        seqSpinner.setSize("65px", "22px");
        seqSpinner.addListener(Events.Change, new Listener<FieldEvent>() {
          public void handleEvent(FieldEvent be) {
        add(seqSpinner, new AbsoluteData(123, 45));

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts