Great, thanks!

- Johannes.

Johan Compagner wrote:

use the new RadioGroup much better and the html is in control of the markup again.



On 10/24/05, *Johannes Fahrenkrug* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi,

    I think that the RadioChoice component doesn't always behave as
    expected. Please take a look at this code:

    RadioChoice zahlungsartRadio = new
    RadioChoice(FIELDNAME_ZAHLUNGSART, new PropertyModel(rechEmpfaenger,
              "zahlungsArt"), zahlungsArten, new ChoiceRenderer() {
            public String getDisplayValue(Object object) {
              if (((String) object).equals("B")) {
                return " Bankeinzug:";
              } else {
                return " Kreditkarte:";
              }
            };
          });

          zahlungsartRadio.setPrefix("<th align=\"left\">");
          zahlungsartRadio.setSuffix ("</th>");
          zahlungsartRadio.add(new AttributeModifier("disabled", true,
    new Model("disabled")));

    This code generates this output:

    <span disabled="disabled" wicket:id="zahlungsartRadio"
    name="zahlungsartRadio">
      <th align="left"><input name="zahlungsartRadio" type="radio"
    value="0"> Bankeinzug:</th>
      <th align="left"><input name="zahlungsartRadio" type="radio"
    checked value="1"> Kreditkarte:</th>
    </span>

    When I set zahlungsartRadio.setRenderBodyOnly(true), I get this
    output:

    <th align="left"><input name="zahlungsartRadio" type="radio"
    value="0"> Bankeinzug:</th>
    <th align="left"><input name="zahlungsartRadio" type="radio"
    checked value="1"> Kreditkarte:</th>

    The first case does set the AttributeModifier, but it's pretty
    useless, becaus I want to disable the radioChoices, not the span tag.
    The second case renders nicer, because there is no span tag to
    mess up the table, but the AttributeModifier isn't set at all.

    I think in the case of the RadioChoice, AttributeModifiers would
    have to be attached to each RadioChoice item, because a
    radioChoice doesn't have a
    "root" tag, like <select> or something where an AttributeModifier
    could be attached to.

    What do you guys think?

    - Johannes.





    -------------------------------------------------------
    This SF.Net email is sponsored by the JBoss Inc.
    Get Certified Today * Register for a JBoss Training Course
    Free Certification Exam for All Training Attendees Through End of 2005
    Visit http://www.jboss.com/services/certification for more information
    _______________________________________________
    Wicket-develop mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/wicket-develop





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to