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

Ricardo Mayerhofer commented on WICKET-2238:
--------------------------------------------

Juergen,
Thanks for your response.

A common complaint is duplication between html and java structure. I think many 
times this can be avoided. A common use case is a input form. Eg.:

setModel( new CompoundPropertyModel( object ) );
add( new TextField( "field1" ) );
add( new TextField( "field2" ) );
add( new TextField( "field3" ) );
...
<input type="text" wicket:id="field1"/>
<input type="text" wicket:id="field2"/>
<input type="text" wicket:id="field3"/>
....

To change this one could add a component resolver that maps, for example, html 
input to TextField component and so on, so that the only work needed is to set 
the model in form. Much easier considering that most inputs are added as 
TextFields, perhaps 80/20 rule Eg.:
Form:
setModel( new CompoundPropertyModel( object ) );

Component resolver:
if ( componentTag.getName().equals( "input" ) ){ 
markupContainer.autoAdd( new TextField( componentTag.getId() ), markupStream );
}

This component resolver currently doens't work because auto components are 
removed. I think this could add a lot of flexibility to wicket and enable 
programmers to simplify code base in database driven web application.

> Keep auto-components after rendering
> ------------------------------------
>
>                 Key: WICKET-2238
>                 URL: https://issues.apache.org/jira/browse/WICKET-2238
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Ricardo Mayerhofer
>            Priority: Minor
>
> Auto-components are removed after rendering, so components added through 
> component resolvers that take user input don't work.
> The code is located in MarkupContainer.java:
> if (component.isAuto()) { children_remove(i); }
> Thanks for considering.

-- 
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