You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2011/01/11 07:45:47 UTC

[jira] Commented: (WICKET-3314) Allow any Component to be a "Panel" or "Fragment" via configuration

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

Sven Meier commented on WICKET-3314:
------------------------------------

I really like this improvement. Two questions:

Couldn't getMarkupSourcingStrategy() always return a default strategy? This would render most null checks in calling methods obsolete.

FormComponentPanel lost its whole markup handling now. Should we replace it with a new class CompoundFormComponent which does the form handling only? Why link this responsibility with any markup strategy?

-Sven

> Allow any Component to be a "Panel" or "Fragment" via configuration
> -------------------------------------------------------------------
>
>                 Key: WICKET-3314
>                 URL: https://issues.apache.org/jira/browse/WICKET-3314
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.5-M3
>            Reporter: Juergen Donnerstag
>         Attachments: wicket-panel.patch
>
>
> currently every component that requires the markup to be in an
> associated file must be derived from Panel. Every component that want
> it's markup "inline" must be derived from Fragment. I've changed that
> and moved the respective source code into something I called markup
> sourcing strategy. I'm not sure it's the best name, so feel free to
> suggest other names. Such a strategy can be provided to any component
> via
> public IMarkupSourcingStrategy getMarkupSourcingStrategy();
> Obviously it makes sense that only one strategy can be associated with
> any component. Each strategy has its own implementations to provide
> the correct markup, handle the header contribution, necessary changes
> to the open tag and it renders the component body appropriately.
> Changing a FormComponent to a FormComponentPanel is now as simple as
> subclassing getMarkupSourcingStrategy(). And it easily be changed to
> become a "FormComponentFragment"
> I've attached a patch (draft) against 1.5 trunk which successfully
> passes all tests in core. I wonder what you think about the idea.
> -Juergen

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