Re: Components containing dynamic number of component
Hi Mael, thank you for your answer. Have you done this your self? In that case can you share some example codes? It is much easier to understand how it should work if I can follow the code. thanks again, Jacob Mael Caldas-2 wrote: Hi Jacob, I Think you have to work on a model that represents better your column... With the the For Component, and a little of polymorphism applied to components and its models you can do It easily. I don't think you have to work with AbstractComponent, RenderBody, or that kind of thing... A tip... always try to work with components hierarchy... When you work with Tapestry, think on Tapestry approach... the things almost are simpler than you think... ;) Mael On 9/26/06, jake123 [EMAIL PROTECTED] wrote: Hi, I am pritty new to tapestry and I am working with tapestry 4.0.2. I have a question about custom components. I have a side column in my application that has a few lines of html and then it should contain one or many components depending on where in the application I use it. my question is: How do I do this? My html file for left column look like this : html body jwcid=$content$ link href=/default/css/leftcolumn.css rel=stylesheet type=text/css / div id=leftColumn div id=innerLeftColumn !-- Login Component -- !-- Article list component -- /div /div /body /html Do I use a abstractComponent and use the renderComponent(IMarkupWriter writer, IRequestCycle cycle) and can the renderBody(writer, cycle) render only one or many components? Thank you for your patience with trivial questions and for any suggestions on how to solve my problems Jacob -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6514321 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6526232 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Components containing dynamic number of component
Hi Jacob, I don't have any didactic example to explain this well, but you can do this like this: For each component, you create a model, or a object that each component receives and interact with him. So, you create a component that receives a List of Objects, iterating over then, and, depending on the type, call the respective component to render. Use If component around each component and the instanceof to evaluate the condition. So, you use the component that receives the List inside your column component, and pass the List of objects to them... If you can't do, I will try to find some code that you can understand... :) Mael On 9/27/06, jake123 [EMAIL PROTECTED] wrote: Hi Mael, thank you for your answer. Have you done this your self? In that case can you share some example codes? It is much easier to understand how it should work if I can follow the code. thanks again, Jacob Mael Caldas-2 wrote: Hi Jacob, I Think you have to work on a model that represents better your column... With the the For Component, and a little of polymorphism applied to components and its models you can do It easily. I don't think you have to work with AbstractComponent, RenderBody, or that kind of thing... A tip... always try to work with components hierarchy... When you work with Tapestry, think on Tapestry approach... the things almost are simpler than you think... ;) Mael On 9/26/06, jake123 [EMAIL PROTECTED] wrote: Hi, I am pritty new to tapestry and I am working with tapestry 4.0.2. I have a question about custom components. I have a side column in my application that has a few lines of html and then it should contain one or many components depending on where in the application I use it. my question is: How do I do this? My html file for left column look like this : html body jwcid=$content$ link href=/default/css/leftcolumn.css rel=stylesheet type=text/css / div id=leftColumn div id=innerLeftColumn !-- Login Component -- !-- Article list component -- /div /div /body /html Do I use a abstractComponent and use the renderComponent(IMarkupWriter writer, IRequestCycle cycle) and can the renderBody(writer, cycle) render only one or many components? Thank you for your patience with trivial questions and for any suggestions on how to solve my problems Jacob -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6514321 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6526232 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Components containing dynamic number of component
Hi, I am pritty new to tapestry and I am working with tapestry 4.0.2. I have a question about custom components. I have a side column in my application that has a few lines of html and then it should contain one or many components depending on where in the application I use it. my question is: How do I do this? My html file for left column look like this : html body jwcid=$content$ link href=/default/css/leftcolumn.css rel=stylesheet type=text/css / div id=leftColumn div id=innerLeftColumn !-- Login Component -- !-- Article list component -- /div /div /body /html Do I use a abstractComponent and use the renderComponent(IMarkupWriter writer, IRequestCycle cycle) and can the renderBody(writer, cycle) render only one or many components? Thank you for your patience with trivial questions and for any suggestions on how to solve my problems Jacob -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6514321 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Components containing dynamic number of component
Hi Jacob, I Think you have to work on a model that represents better your column... With the the For Component, and a little of polymorphism applied to components and its models you can do It easily. I don't think you have to work with AbstractComponent, RenderBody, or that kind of thing... A tip... always try to work with components hierarchy... When you work with Tapestry, think on Tapestry approach... the things almost are simpler than you think... ;) Mael On 9/26/06, jake123 [EMAIL PROTECTED] wrote: Hi, I am pritty new to tapestry and I am working with tapestry 4.0.2. I have a question about custom components. I have a side column in my application that has a few lines of html and then it should contain one or many components depending on where in the application I use it. my question is: How do I do this? My html file for left column look like this : html body jwcid=$content$ link href=/default/css/leftcolumn.css rel=stylesheet type=text/css / div id=leftColumn div id=innerLeftColumn !-- Login Component -- !-- Article list component -- /div /div /body /html Do I use a abstractComponent and use the renderComponent(IMarkupWriter writer, IRequestCycle cycle) and can the renderBody(writer, cycle) render only one or many components? Thank you for your patience with trivial questions and for any suggestions on how to solve my problems Jacob -- View this message in context: http://www.nabble.com/Components-containing-dynamic-number-of-component-tf2340643.html#a6514321 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]