All the buttons below are generated via ch5-template. When a button from the second row is clicked the corresponding button from the row above will be toggled.
The first ch5-template will receive an attribute "templateId" which represents the id of the template it needs to generate, in this case the id will be: "transportbuttons". The second attribute is the context: "TRANSBTNS:receive".
The template can be reused again by providing another ch5-template, in this case the context is identical so the same signals will be used.
<p> All the buttons below are generated via ch5-template. When a button from the second row is clicked the corresponding button from the row above will be toggled. </p> <p>The first ch5-template will receive an attribute <i>"templateId"</i> which represents the id of the template it needs to generate, in this case the id will be: <i>"transportbuttons"</i>. The second attribute is the context: "TRANSBTNS:receive". </p> <ul> <li> The first substring before the colon represents the original name of the signal while the second one represents the replacement name. </li> <li>Therefore if a component has a receiveStateSelected="<i><b>TRANSBTNS</b>.prevtrack_selected"</i> attribute, its value will become receiveStateSelected="<i><b>receive</b>.prevtrack_selected"</i> </li> </ul> <template id="transportbuttons"> <div class="TRANSBTNS"> <ch5-button customClass="trnsbtns__prev" id="TRANSBTNS.prevtrack" shape="rounded-rectangle" iconClass="material-icons fast_rewind" sendEventOnClick="TRANSBTNS.prevtrack_clicked" receiveStateSelected="TRANSBTNS.prevtrack_selected"> </ch5-button> <ch5-button customClass="trnsbtns__play" id="TRANSBTNS.play" shape="rounded-rectangle" iconClass="material-icons play_arrow" sendEventOnClick="TRANSBTNS.play_clicked" receiveStateSelected="TRANSBTNS.play_selected"> </ch5-button> <ch5-button customClass="trnsbtns__next" id="TRANSBTNS.nexttrack" shape="rounded-rectangle" iconClass="material-icons fast_forward" sendEventOnClick="TRANSBTNS.nexttrack_clicked" receiveStateSelected="TRANSBTNS.nexttrack_selected"> </ch5-button> <ch5-button customClass="trnsbtns__record" id="TRANSBTNS.record" shape="rounded-rectangle" iconClass="material-icons fiber_manual_record" sendEventOnClick="TRANSBTNS.record_clicked" receiveStateSelected="TRANSBTNS.record_selected"> </ch5-button> <ch5-button customClass="trnsbtns__stop" id="TRANSBTNS.stop" shape="rounded-rectangle" iconClass="material-icons stop" sendEventOnClick="TRANSBTNS.stop_clicked"> </ch5-button> <ch5-button customClass="trnsbtns__pause" id="TRANSBTNS.pause" shape="rounded-rectangle" iconClass="material-icons pause" sendEventOnClick="TRANSBTNS.pause_clicked" receiveStateSelected="TRANSBTNS.pause_selected"> </ch5-button> </div> </template> <template id="transportbuttons_nextline"> <div class="TRANSBTNS"> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons fast_rewind" receiveStateSelected="TRANSBTNS.prevtrack_selected"> </ch5-button> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons play_arrow" receiveStateSelected="TRANSBTNS.play_selected"> </ch5-button> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons fast_forward" receiveStateSelected="TRANSBTNS.nexttrack_selected"> </ch5-button> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons fiber_manual_record" receiveStateSelected="TRANSBTNS.record_selected"> </ch5-button> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons stop" receiveStateSelected="TRANSBTNS.stop_selected"> </ch5-button> <ch5-button shape="rounded-rectangle" type="text" iconClass="material-icons pause" receiveStateSelected="TRANSBTNS.pause_selected"> </ch5-button> </div> </template> <ch5-template id="receive" templateid="transportbuttons_nextline" context="TRANSBTNS:receive"></ch5-template> <ch5-template id="directv" receiveStateShow="directv.show" templateid="transportbuttons" context="TRANSBTNS:directv"></ch5-template> <div id="textcontent" class="b-red" data-ch5-textcontent="selected_button"> [Testing ch5-template] </div> <p> The template can be reused again by providing another ch5-template, in this case the context is identical so the same signals will be used. </p> <ch5-template id="directv" receiveStateShow="directv.show" templateid="transportbuttons" context="TRANSBTNS:directv"></ch5-template>
.b-red{ margin:20px; border:3px solid #004A80; } .material-icons.fast_rewind:before { content:"fast_rewind"; } .material-icons.play_arrow:before { content:"play_arrow"; } .material-icons.fast_forward:before { content:"fast_forward"; } .material-icons.stop:before { content:"stop"; } .material-icons.fiber_manual_record:before { content:"fiber_manual_record"; } .material-icons.pause:before { content:"pause"; } ch5-button { padding: 3px 0; } .ch5-button--text.ch5-button--selected { background-color: #1496ED; } .receive{ padding: 5px; margin: 5px; border: 1px solid grey; } .directv{ padding: 5px; margin: 5px; border: 1px solid lightblue; }