[ 
https://issues.apache.org/jira/browse/WICKET-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769851#action_12769851
 ] 

Juergen Donnerstag commented on WICKET-2541:
--------------------------------------------

Sorry, you are right. I thought I used it this way once. But it wouldn't be 
Wicket if there weren't other options, especially since wicket:enclosure is a 
convenience component only to save some boiler plate.

<span wicket:id="myEnclosure">
  <span wicket:id="A"> ...</span>
  <span wicket:id="B"> ...</span>
</span>

and (pseudo code)

final Label aaa = new Label("A");
final Label bbb = new Label("B");

MarkupContainer enclosure = new WebMarkupContainer("enclosure", ...)
{
   public boolen isVisible() {
       return aaa.isVisible();
   {
};

// don't want the surrounding span tag 
enclosure.setRenderBoldyOnly(true);

add(enclosure);

enclosure.add(aaa);
enclosure.add(bbb);


> FormComponents hidden by wicket:enclosure should not be validated upon form 
> submit
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2541
>                 URL: https://issues.apache.org/jira/browse/WICKET-2541
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.3
>            Reporter: Christian Oldiges
>            Priority: Minor
>
> FormComponents that are hidden by an enclosing wicket:enclosure tag should 
> not by validated.
> If there is a form with 2 form components A and B and an enclosure is used to 
> hide both A and B and it is controlled by B.isVisible (wicket:enclosure 
> child="B"), the FormComponent A is still validated.
> Simple example: a RequiredTextField is still required even if made invisible 
> by a surrounding enclosure.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to