Re: How to add a component in a behavior ?
hi Just a question, about this suggestion : wicket:composernormal html or wicket componentswicket:composedComponentnormal html or wicket components /wicket:composer Is it completely far off or could it be interesting ? What do you think of it ? thanks in advance ++ -- View this message in context: http://www.nabble.com/How-to-add-a-component-in-a-behavior---tp21758993p21903642.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add a component in a behavior ?
igor.vaynberg wrote: you cant because it wont have any markup to attach to, instead you can simply output the messages yourself, see my reply to this thread: Thanks a lot Igor However, I'm a bit upset not to be able to use other components in a Behavior, it kind of breaks the Wicket way of doing things. Thinking about that, I was wondering whether it would be possible to have Behavior with markup attached working this way, let's called it composer : wicket:composernormal html or wicket componentswicket:composedComponentnormal html or wicket components /wicket:composer The idea is to be able to enrich a component through the composer (or whatever name is best suited) : the component whom the composer is added would be surrounded by the content of the wicket:composer component (be it html or components). It would avoid the use of component.getResponse().write(XX) and allow the use of components. For sure it might not be perfect, for example multiple composers on the same composedComponent might be tricky, but overall, what do you think of the idea ? ++ zedros -- View this message in context: http://www.nabble.com/How-to-add-a-component-in-a-behavior---tp21758993p21820319.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add a component in a behavior ?
igor.vaynberg wrote: exactly how does this break the wicket way? behaviors are meant to augment rendering of components -igor I hope the wording wasn't offensive, it wasn't the aim at all. back to the topic : here, instead of using a feedback panel (which was exactly what was needed), the solution is to copy/paste/adapt the feedback panel inside the behavior. However, simply adding the feedbackpanel in it like this would have done the trick : FeedbackPanel dedicatedFP = new FeedbackPanel(fbLabel); dedicatedFP.setFilter(new IFeedbackMessageFilter(){ public boolean accept(FeedbackMessage message) { if (message.getReporter().equals(myComponent) !(message.isRendered())){ message.markRendered(); return true ; }else{ return false ; } }}); add(dedicatedFP); Simply put, I found it odd to rewrite some already existing component. Furthermore, doing it directly through write(xxx) commands feels like good old servlet and not like wicket, which usually provides a html template. Where is the usual separation between code and presentation ? Hence this suggestion of a composer, which I thought might nicely solve this issue (clean separation of html and Java, possibility to add components). thanks for your time responding ! zedros -- View this message in context: http://www.nabble.com/How-to-add-a-component-in-a-behavior---tp21758993p21821052.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add a component in a behavior ?
However, I'm a bit upset not to be able to use other components in a Behavior, it kind of breaks the Wicket way of doing things. exactly how does this break the wicket way? behaviors are meant to augment rendering of components -igor On Tue, Feb 3, 2009 at 2:28 PM, ZedroS zedros.schwa...@gmail.com wrote: igor.vaynberg wrote: you cant because it wont have any markup to attach to, instead you can simply output the messages yourself, see my reply to this thread: Thanks a lot Igor However, I'm a bit upset not to be able to use other components in a Behavior, it kind of breaks the Wicket way of doing things. Thinking about that, I was wondering whether it would be possible to have Behavior with markup attached working this way, let's called it composer : wicket:composernormal html or wicket componentswicket:composedComponentnormal html or wicket components /wicket:composer The idea is to be able to enrich a component through the composer (or whatever name is best suited) : the component whom the composer is added would be surrounded by the content of the wicket:composer component (be it html or components). It would avoid the use of component.getResponse().write(XX) and allow the use of components. For sure it might not be perfect, for example multiple composers on the same composedComponent might be tricky, but overall, what do you think of the idea ? ++ zedros -- View this message in context: http://www.nabble.com/How-to-add-a-component-in-a-behavior---tp21758993p21820319.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add a component in a behavior ?
you cant because it wont have any markup to attach to, instead you can simply output the messages yourself, see my reply to this thread: Form Components With Built In Feedback -igor On Fri, Jan 30, 2009 at 6:04 PM, ZedroS zedros.schwa...@gmail.com wrote: Hi I'm using a behaviour to add component's label like this : public class AddLabelBehavior extends AbstractBehavior { @Override public void beforeRender(Component component) { super.beforeRender(component); component.getResponse().write(new StringResourceModel(component.getId(),component,null,component.getId()).getString() + : ); } } However, I would like to add as well a dedicated feedbackpanel just after the component in question. In short, it's just a component that I would like to add (both in the Java code and html rendered) just after my component. Is it possible ? If so, how ? NB : I guess it should use onRendered(Component component) but I don't see how to add a component. Thanks in advance best, zedros -- View this message in context: http://www.nabble.com/How-to-add-a-component-in-a-behavior---tp21758993p21758993.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org