Powered by
       Contelligent ®
 
Über Contelligent
Warum Contelligent
Produkte
Downloads
Support
Neuigkeiten

    Parameterized Rendering

    While including content and rendering components the way mentioned above is easy and sufficient for some tasks, there are more things you have to know to master all aspects of contelligent markup capabilities.

    One thing is the possibility to influence the render behaviour of a component by Parameterized Rendering. We will take a closer look at it now.

    In general, components are responsible to render themselves. The component using a render instruction to include a component cannot do much about it's render behaviour. Nevertheless, it is true that in some occasions it makes sense for components to render themselves in different modes. To allow component embedders to specify which mode to use contelligent introduces a mechanism called Parameterized Rendering.

    Parameterized Rendering allows a component to influence, how a component will be rendered by passing parameters to the finix:render instruction. This is achieved by a mechanism that people familiar with HTTPs GET operation should get used to quite easily. The tutorial includes the following example to illustrate this:

    Component-Tree Parameterized Rendering

    <html>
        <head>
          ...
        </head>
    
        <body>
          <div class="output-box">
    	<div class="left-title">Mode ref (Default):</div>
            <div class="code">
                <finix:render path="subpage?mode=ref"/> 
    		-> will render a link reference</div>
    	<div class="left-title">Mode link + text:</div>
            <div class="code">
                <finix:render path="subpage?mode=link&text=LinkText"/>
    		-> mode to render a html link</div>
    	<div class="left-title">Mode Markup:</div>
            <div class="code">
                <finix:render path="subpage?mode=markup"/></div>
          </div>
    
        </body>
    </html>
    

    Markup of ParameterizedRendering

    ==> view example

    The parameterized render tags above will instruct the contelligent.website.page component to render itself in different modes.

    <finix:render path="subpage?mode=ref"/> will instruct the component to render itself in ref mode. Rendering in ref mode will yield the global URL to the page component.

    <finix:render path="subpage?mode=link&text=LinkText"/> will instruct the component to render itself in link mode. Rendering in link mode will render a html link using the parameter text as the link text.

    <finix:render path="subpage?mode=markup"/> will instruct the component to render itself in markup mode. Rendering in markup mode will render the content of the referenced page.

    Now you may wonder how you should know about what parameters are actually recognized by a specific component. The answer is quite practical. The contelligent fat client provides you with a wizard whenever you add a component reference to a template by drag and drop. A screenshot of the Render Mode Wizard is given below.

    Render Mode Wizard


    While parameter rendering is a way to explicitly influence how a component will render itself by providing parameters to the render instruction, category rendering is an implicit rendering method that allows a component to define different templates, recources, etc. that are used in different rendering contexts. The next tutorial step will cover this topic, so go ahead.

    See also

    Markup Basics, Markup Basics II, Category Rendering

    Copyright © 2012 C:1 Financial Services GmbH