You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Brian Topping (JIRA)" <ji...@apache.org> on 2008/10/24 03:21:44 UTC

[jira] Created: (WICKET-1892) FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation

FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation
--------------------------------------------------------------------------------------------------

                 Key: WICKET-1892
                 URL: https://issues.apache.org/jira/browse/WICKET-1892
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-M3
            Reporter: Brian Topping
            Priority: Minor


Our UI person developed a UI where the feedback list was rendered on a light red background.  The idea is if there is a problem, a large red box would visually highlight the rendered list.  

I set a breakpoint at the anonymous implementation of Component.isVisible() in the constructor for FeedbackPanel and it is correctly returning false when there are no items in the feedback list.  And if the code from WIA is used with a CSS class, we might presume:

<div wicket:id="feedback" class="errorBackground"/>

But this is not the component that is made invisible, it is the child (the component with id "feedbackul").  So I tried to wrap this with an enclosure using the feedbackul as a child, but I presume because of the special late-rendering nature of a feedback panel, it could not be found (chicken-egg).  

It seems like the ideal solution is to have the feedbackul component look to it's parent and also make it invisible if it's child is invisible, or some variety of that.  For now, I am going to try subclassing FeedbackPanel and have it guess at the child to check visibility.  But that's got it's own set of ugly... it's a large constructor that needs to be duplicated since the code we care about is in the anonymous component created in the constructor (so we can't call super and then patch up the returned remains).

Please let me know if I can provide any other information!  :-)

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


[jira] Commented: (WICKET-1892) FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation

Posted by "Brian Topping (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642781#action_12642781 ] 

Brian Topping commented on WICKET-1892:
---------------------------------------

Hi Igor,

Thanks for your response.  I don't understand how this is not an issue.  If user markup attaches a feedback component to a <div> the div should not be rendered if there is no feedback.  

While in reality, there is a subcomponent to the div (the rendering of the <ol>) and it is indeed made invisible, my expectation as a user is the markup that I attached the component to is what should be made invisible.  Maybe I have a base misunderstanding here, but when I attach a component to markup, I am effectively giving ownership of the markup to the component.  If it is trying to make the markup invisible, it should actually do it!

Does that make sense?

The corollary question is what damage does it cause if FeedbackPanel took ownership of the user markup?

In the end, I'm already subclassing, my point is it doesn't seem like the right thing to do, that's all.  

Best, B

> FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1892
>                 URL: https://issues.apache.org/jira/browse/WICKET-1892
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> Our UI person developed a UI where the feedback list was rendered on a light red background.  The idea is if there is a problem, a large red box would visually highlight the rendered list.  
> I set a breakpoint at the anonymous implementation of Component.isVisible() in the constructor for FeedbackPanel and it is correctly returning false when there are no items in the feedback list.  And if the code from WIA is used with a CSS class, we might presume:
> <div wicket:id="feedback" class="errorBackground"/>
> But this is not the component that is made invisible, it is the child (the component with id "feedbackul").  So I tried to wrap this with an enclosure using the feedbackul as a child, but I presume because of the special late-rendering nature of a feedback panel, it could not be found (chicken-egg).  
> It seems like the ideal solution is to have the feedbackul component look to it's parent and also make it invisible if it's child is invisible, or some variety of that.  For now, I am going to try subclassing FeedbackPanel and have it guess at the child to check visibility.  But that's got it's own set of ugly... it's a large constructor that needs to be duplicated since the code we care about is in the anonymous component created in the constructor (so we can't call super and then patch up the returned remains).
> Please let me know if I can provide any other information!  :-)

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


[jira] Commented: (WICKET-1892) FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation

Posted by "Brian Topping (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642363#action_12642363 ] 

Brian Topping commented on WICKET-1892:
---------------------------------------

Here's a better solution:

In the page that wants to use the FeedbackPanel, instantiate it as follows:

        add(new FeedbackPanel("feedback") {
            public boolean isVisible() {
                return get("feedbackul").isVisible();
            }
        });

Seemes this isVisible implementation could be put in to FeedbackPanel, no?

> FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1892
>                 URL: https://issues.apache.org/jira/browse/WICKET-1892
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Brian Topping
>            Priority: Minor
>
> Our UI person developed a UI where the feedback list was rendered on a light red background.  The idea is if there is a problem, a large red box would visually highlight the rendered list.  
> I set a breakpoint at the anonymous implementation of Component.isVisible() in the constructor for FeedbackPanel and it is correctly returning false when there are no items in the feedback list.  And if the code from WIA is used with a CSS class, we might presume:
> <div wicket:id="feedback" class="errorBackground"/>
> But this is not the component that is made invisible, it is the child (the component with id "feedbackul").  So I tried to wrap this with an enclosure using the feedbackul as a child, but I presume because of the special late-rendering nature of a feedback panel, it could not be found (chicken-egg).  
> It seems like the ideal solution is to have the feedbackul component look to it's parent and also make it invisible if it's child is invisible, or some variety of that.  For now, I am going to try subclassing FeedbackPanel and have it guess at the child to check visibility.  But that's got it's own set of ugly... it's a large constructor that needs to be duplicated since the code we care about is in the anonymous component created in the constructor (so we can't call super and then patch up the returned remains).
> Please let me know if I can provide any other information!  :-)

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


[jira] Resolved: (WICKET-1892) FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1892.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

this is not a bug, this is how the feedback panel is meant to work.

there is nothing stopping you from creating your own subclass that works the way you want

class myfeedbackpanel extends feedbackpanel {
  public boolean isvisible() {
        return anymessage();
  }
}


> FeedbackPanel can't be conditionally wrapped with background -- problem with isVisible propagation
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1892
>                 URL: https://issues.apache.org/jira/browse/WICKET-1892
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M3
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> Our UI person developed a UI where the feedback list was rendered on a light red background.  The idea is if there is a problem, a large red box would visually highlight the rendered list.  
> I set a breakpoint at the anonymous implementation of Component.isVisible() in the constructor for FeedbackPanel and it is correctly returning false when there are no items in the feedback list.  And if the code from WIA is used with a CSS class, we might presume:
> <div wicket:id="feedback" class="errorBackground"/>
> But this is not the component that is made invisible, it is the child (the component with id "feedbackul").  So I tried to wrap this with an enclosure using the feedbackul as a child, but I presume because of the special late-rendering nature of a feedback panel, it could not be found (chicken-egg).  
> It seems like the ideal solution is to have the feedbackul component look to it's parent and also make it invisible if it's child is invisible, or some variety of that.  For now, I am going to try subclassing FeedbackPanel and have it guess at the child to check visibility.  But that's got it's own set of ugly... it's a large constructor that needs to be duplicated since the code we care about is in the anonymous component created in the constructor (so we can't call super and then patch up the returned remains).
> Please let me know if I can provide any other information!  :-)

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