You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jean-Francois Larouche (JIRA)" <ji...@apache.org> on 2010/11/19 11:27:16 UTC

[jira] Created: (WICKET-3179) Default Component Behaviors

Default Component Behaviors
---------------------------

                 Key: WICKET-3179
                 URL: https://issues.apache.org/jira/browse/WICKET-3179
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.4.13
         Environment: Java 1.6, Windows.
            Reporter: Jean-Francois Larouche
            Priority: Minor


Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.

We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.

Would this be possible/make sense:

When the components renders, they call getBehaviors();

getBehaviors() could then not only get the Component one but also call

Application.get().getDefaultComponentBehavior(); and return the merged list.

This does not affect anything in current wicket implementation.

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


Re: [jira] Created: (WICKET-3179) Default Component Behaviors

Posted by Pedro Santos <pe...@gmail.com>.
Hi Jean, you can add an IComponentInstantiationListener to do that on your
app.

On Fri, Nov 19, 2010 at 8:27 AM, Jean-Francois Larouche (JIRA) <
jira@apache.org> wrote:

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>
>
> Weve got a little problem and i dont know if theres another way to do this.
> Ive searched and found nothing.
>
> We need to add some sort of ErrorBehavior to all of our form components.
> And the code duplication starts to be very ugly.
>
> Would this be possible/make sense:
>
> When the components renders, they call getBehaviors();
>
> getBehaviors() could then not only get the Component one but also call
>
> Application.get().getDefaultComponentBehavior(); and return the merged
> list.
>
> This does not affect anything in current wicket implementation.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
Pedro Henrique Oliveira dos Santos

[jira] Updated: (WICKET-3179) Default Component Behaviors

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

Jeremy Thomerson updated WICKET-3179:
-------------------------------------

    Fix Version/s:     (was: 1.5-M4)
                       (was: 1.4.14)

Removing fix versions on things that were marked as fixVersion = (1.4.14 || 1.5-M4), but also weren't fixed (marked "not a problem", "won't fix", etc) so that they don't show up in release notes when in reality they weren't part of the release.

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.
> We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.
> Would this be possible/make sense:
> When the components renders, they call getBehaviors();
> getBehaviors() could then not only get the Component one but also call
> Application.get().getDefaultComponentBehavior(); and return the merged list.
> This does not affect anything in current wicket implementation.

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


[jira] Commented: (WICKET-3179) Default Component Behaviors

Posted by "Jean-Francois Larouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933763#action_12933763 ] 

Jean-Francois Larouche commented on WICKET-3179:
------------------------------------------------

Well, it doesn't help that much.

We will need to duplicate that code for every form creation.

Even if we create a BaseForm object for the application we will still need to modify so much files.
Its also something we try to not do.

Oh well, thanks anyway.

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>             Fix For: 1.4.14, 1.5-M4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.
> We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.
> Would this be possible/make sense:
> When the components renders, they call getBehaviors();
> getBehaviors() could then not only get the Component one but also call
> Application.get().getDefaultComponentBehavior(); and return the merged list.
> This does not affect anything in current wicket implementation.

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


[jira] Commented: (WICKET-3179) Default Component Behaviors

Posted by "Jean-Francois Larouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933766#action_12933766 ] 

Jean-Francois Larouche commented on WICKET-3179:
------------------------------------------------

Oh!

Thats a nice one!

I should have searched more, i checked listeners but tough it was a dumb idea to look there.

Thanks a lot!

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>             Fix For: 1.4.14, 1.5-M4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.
> We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.
> Would this be possible/make sense:
> When the components renders, they call getBehaviors();
> getBehaviors() could then not only get the Component one but also call
> Application.get().getDefaultComponentBehavior(); and return the merged list.
> This does not affect anything in current wicket implementation.

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


[jira] Closed: (WICKET-3179) Default Component Behaviors

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

Martin Grigorov closed WICKET-3179.
-----------------------------------

       Resolution: Not A Problem
    Fix Version/s: 1.5-M4
                   1.4.14

You can visit the children of the Form and add the behaviors:

Form form = new Form("formId") {

 protected void onConfigure() {
  super.onConfigure();

  visitChildren(FormComponent.class, new IVisitor<FormComponent>() {
	public Object component(FormComponent component) {

             // pseudo code
             if component has no mybehavior then
                  component.add(mybehavior);
             fi
             return CONTINUE_TRAVERSAL;
	}
});
}

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>             Fix For: 1.4.14, 1.5-M4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.
> We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.
> Would this be possible/make sense:
> When the components renders, they call getBehaviors();
> getBehaviors() could then not only get the Component one but also call
> Application.get().getDefaultComponentBehavior(); and return the merged list.
> This does not affect anything in current wicket implementation.

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


[jira] Commented: (WICKET-3179) Default Component Behaviors

Posted by "Pedro Santos (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933764#action_12933764 ] 

Pedro Santos commented on WICKET-3179:
--------------------------------------

Hi Jean, you can also add an IComponentInstantiationListener to do that on your application init method like:

    MyListenerAddindSome implements IComponentInstantiationListener {
        public void onInstantiation(Component component) {
            if (component instanceof FormComponent) {
                //add some behavior
            }
        }
    }

> Default Component Behaviors
> ---------------------------
>
>                 Key: WICKET-3179
>                 URL: https://issues.apache.org/jira/browse/WICKET-3179
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.13
>         Environment: Java 1.6, Windows.
>            Reporter: Jean-Francois Larouche
>            Priority: Minor
>             Fix For: 1.4.14, 1.5-M4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Weve got a little problem and i dont know if theres another way to do this. Ive searched and found nothing.
> We need to add some sort of ErrorBehavior to all of our form components. And the code duplication starts to be very ugly.
> Would this be possible/make sense:
> When the components renders, they call getBehaviors();
> getBehaviors() could then not only get the Component one but also call
> Application.get().getDefaultComponentBehavior(); and return the merged list.
> This does not affect anything in current wicket implementation.

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