Results 1 to 5 of 5

Thread: Toggle Button

  1. #1

    Default Toggle Button

    I do need a feature for Button (Pressed and UnPressed) like a toggle Button. Can some one let me know if it can be done using GXT.

    I am using Window as DialogBox having a Custom Button on it and will make a Service Call on clicking the button. I need to display a error message on the same Dialog Box down the Button. Would like to know if there is some thing that is provided by GXT.



    Thanks,
    Novice Member.

  2. #2

    Default Toggle Button

    Is there a Sample Demo available for Toggle Button Widget?

  3. #3
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239

    Default

    Code:
    package com.peoplenet.demo.client;
    
    import com.extjs.gxt.ui.client.event.ComponentEvent;
    import com.extjs.gxt.ui.client.event.SelectionListener;
    import com.extjs.gxt.ui.client.widget.button.ToggleButton;
    import com.extjs.gxt.ui.client.widget.form.LabelField;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class test implements EntryPoint {
    
         public void onModuleLoad() {
            final ToggleButton toggle = new ToggleButton("test");
            final LabelField label = new LabelField();
            
            toggle.addSelectionListener(new SelectionListener<ComponentEvent>(){
                @Override
                public void componentSelected(ComponentEvent ce) {
                    if(toggle.isPressed())
                    {
                        label.setText("button pressed");
                    }else 
                    {
                        label.setText("button released");
                    }
                    
                }
            });
             RootPanel.get().add(label);
             RootPanel.get().add(toggle);
            }
    }
    This might help

  4. #4

  5. #5
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239

    Default

    well if you go through the api there is togglebutton widget which is what you are looking for .

Posting Permissions

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