public class FormFeedbackBelowBorder extends Border implements
IFeedback {

    private static final long serialVersionUID = 1L;
    private String inputStyleClassNormal;
    private String inputStyleClassFeedback;
    private MyFeedbackLabel feedbackLabel;
    // feedbackContainer: So we can make it invisible.
    private WebMarkupContainer feedbackContainer;
    // component: Required for filters
    private Component component;

    public FormFeedbackBelowBorder(final String id, Component
component,
            final String inputStyleClassNormal, final String
inputStyleClassFeedback) {
        super(id);
        this.component = component;
        this.inputStyleClassNormal = inputStyleClassNormal;
        this.inputStyleClassFeedback = inputStyleClassFeedback;
        // Insert component into <wicket:body/> of this container:
        this.getBodyContainer().add(component);
        // MarkupContainer is required so that the <br/> can be hidden
if no
        // feedback is shown
        this.feedbackContainer =
                new WebMarkupContainer("feedbackContainer");
        this.feedbackLabel = new MyFeedbackLabel("feedbackLabel",
component);
        this.feedbackContainer.add(this.feedbackLabel);
        add(this.feedbackContainer);
    }

Regards,

Bernard




On Sun, 28 Aug 2011 14:18:34 +0300, you wrote:

>it should be possible
>show the java code
>
>On Sun, Aug 28, 2011 at 2:19 PM,  <[email protected]> wrote:
>> Hi,
>>
>> The following markup is used to stuff a form component inside the body
>> of a border where validation feedback is displayed below the form
>> component:
>>
>> <wicket:border>
>>    <wicket:body>Form Component</wicket:body>
>>    <!-- feedbackContainer because of the <br/> tag that has to be
>> removed
>>    if feedbackLabel is empty -->
>>    <span wicket:id = "feedbackContainer"><br/>
>>        <span wicket:id="feedbackLabel">Feedback here</span>
>>    </span>
>> </wicket:border>
>>
>> In 1.4, this works as expected.
>>
>> In 1.5, I get an error:
>>
>> Unable to find component with id 'feedbackContainer' in
>> [FormFeedbackBelowBorder [Component id = emailFeedback]]
>>        Expected:
>> 'formPanel:registerForm:emailFeedback.feedbackContainer'.
>>        Found with similar names:
>> 'formPanel:registerForm:emailFeedback:emailFeedback_body:feedbackContainer'
>>
>> It looks like Wicket thinks that the feedbackContainer is inside the
>> bodyContainer which it obviously isn't.
>>
>> Is it no longer possible in 1.5 to add wicket tags inside
>> <wicket:border> but outside its <wicket:body>?
>>
>> Thanks,
>>
>> Bernard
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to