Announcement

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

    Button with checkbox type setstate

    dear smartgwt community members,

    I'm havong trouble setting "checked" initial state for a button with SelectionType.CHECKBOX action type.

    please consider following code

    Button toggle = new Button();
    toggle.setActionType(SelectionType.CHECKBOX);
    toggle.setState(State.STATE_DOWN);

    that is the only way how to set initial state to "checked" that I found. However when I forst hit the button, it stays down, no matter what I do and goes up with the second click.

    Is there another way to set the initial state to "checked", other than creating the button and firing the onClick event manually (which is not what I'm looking for, as it adds overhead to application intial state startup - EDIT: which actually doesn't work either, because the button stays unchecked even so!!)

    thank you very much,
    -- peter
    Last edited by petrkalina; 11 Aug 2009, 03:47.

    #2
    Any advice?
    I am trying to paint a Toolstrip like this, but with one of the buttons initially "clicked down":
    http://www.smartclient.com/smartgwt/showcase/#toolstrip

    Comment


      #3
      This seems to work:
      toolStripButton.setSelected (true);

      Comment

      Working...
      X