GIGJ.COM
welcome to my space
X
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
Welcome to:gigj.com
Search:  
NAVIGATION: Home >>
Radio buttons lost field label?
Published by: smith 2010-03-15
  • I haven't changed any of my code, but for some reason the code in SVN produces radio buttons (Radios) that don't show the field label. I'm creating them as follows:

    ---

    RadioGroup group = new RadioGroup()
    form.add(group);
    group.setFieldLabel("Gender");

    Radio field = new Radio();
    field.setFieldLabel("Male");
    field.setName("Gender");
    group.add(field);

    field = new Radio();
    field.setFieldLabel("Female");
    field.setName("Gender");
    group.add(field);

    ----

    I haven't changed this code in a while, but for some reason the labels are gone with the most recent source. This is the same way that the demo does it too so I'm a bit lost.

    -m


  • Same to me.
    The latest version from SVN does not draw any radio labels. You can see this behavior at the Explorer demo (FormPanel). It occurs in IE7 and FF3 as well.
    TWikiForms < TWiki04x01 < TWiki::
    in edit mode using edit fields, radio buttons, check boxes and list boxes. If a label field has no name, it will not be shown when the form is viewed, only
    http://twiki.org/cgi-bin/view/TWiki04x01/TWikiForms
    HOME
    WebAIM: E-mail List Archives::
    radio buttons under it, each button with its label on one line. This means is true that clicking on the labels is lost, but. thats true for all matrix
    http://www.webaim.org/discussion/mail_thread.php?thread=2898
    HOME

    -Sebastian

    BTW FormPanel: the third label in the 'Music' line seems to be hidden too, isn't?


  • If I change the code above to:

    ---

    RadioGroup group = new RadioGroup()
    form.add(group);
    group.setFieldLabel("Gender");

    Radio field = new Radio();
    field.setFieldLabel("Male");
    -----> field.setBoxLabel("Male");
    field.setName("Gender");
    group.add(field);

    field = new Radio();
    field.setFieldLabel("Female");
    -----> field.setBoxLabel("Male");
    field.setName("Gender");
    group.add(field);

    ----

    Then it works again. That is, add the value "field.setBoxLabel()". Not sure why this is, but it works for me for those of you out there watching.


  • To summarize it:

    This is your code in the FormPanel demo:


    RadioGroup radioGroup = new RadioGroup("test");
    radioGroup.setFieldLabel("Favorite Color");
    radioGroup.add(radio);
    radioGroup.add(radio2);
    panel.add(radioGroup);

    TextArea description = new TextArea();
    description.setPreventScrollbars(true);
    description.setFieldLabel("Description");
    panel.add(description);

    panel.addButton(new Button("Save"));
    panel.addButton(new Button("Cancel"));

    add(panel);
    And this is what FireBug says:








  • I did use Firebug to inspect and the field label isn't there. Sorry I fogot to mention that.


  • I do not see any problems with the code you posted. Can you put together some complete test code? You can also use Firebug to inspect the DOM to see if the label and text exist.


  • setBoxLabel is the correct method for setting the label check boxes and radios. Some of the demo pages were using setFieldLabel. This is fixed in SVN.





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks
    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Radio buttons lost field label? , Please add it free.
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 gigj.com        Site made:CFZ