Back to data overview

View Example 8: Multiple components with same data

SWAC optimises data fetching to avoid unecessery requests for the same data. This is archived useing datasource based databinding (going over the dataset based databinding in other frameworks). This has some advantages and disatvanages:

Important things to consider:

VIEW-Requestor

<div id="view_example8_1" swa="Present FROM http://localhost:8080/SmartDataTest/smartdata/records/tbl_observedobject?storage=smartmonitoring">
    <ol>
        <li class="swac_repeatForSet" swac_id="{id}" swac_parent="{parent}">
            {name}
            <ol class="swac_forChilds">
                <li class="swac_child" swac_id="{id}" swac_parent="{parent}">
                    > {name}
                    <ol class="swac_forChilds">
                        <li class="swac_child" swac_id="{id}" swac_parent="{parent}">
                            >> {name}
                        </li>
                    </ol>
                </li>
            </ol>
       </li>
    </ol>
</div>  
        
The second component uses a where clause so got data is different from the first request even if its from same datasource:

<div id="view_example8_2" swa="Present FROM http://localhost:8080/SmartDataTest/smartdata/records/tbl_observedobject?storage=smartmonitoring WHERE countonly=true"></div>
            
CONFIGURATION

No configuration needed

DATASOURCE This example needs a live datasource, because the outcoming depends on the given WHERE clauses, which is not simulateble with data files.
  1. {name}
    1. > {name}
      1. >> {name}
Back to data overview