Openhab - Dynamic slider (rules?)

Hi,

i have a custom template with this code in habpanel template:

<div class="row">
  <div class="col-sm-1">1:05</div>
	<div class="col-sm-10">
		<div ng-init="sliderPosition = {
            'item': 'HEOSWoonkamerCurrentPosition',
            'vertical': false,
            'floor': 0,
            'ceil': 100,
            'step': 1,
            'precision': 1,
            'unit': '',
            'hidelabel': true,
            'hidelimits': false,
            'hidepointer': false,
            'showticks': false,
            'bigslider': false
            }">
		</div>
		<widget-slider ng-model="sliderPosition"/>
	</div>
	<div class="col-sm-1">3:45</div>
</div>

I want when the next track is loaded, the end time (3:45) automatic update, i have one item HEOSWoonkamerDuration, with the time of the track. How can I dynamically adjust the max value of the slider??

Must i create a rule or another item???

I found this


but maybe there is something you can use