cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Time based Scroll Panel values

Airin
11-Garnet

Time based Scroll Panel values

Hi All,

 

I have a query regarding how to add values to a scrollable panel so that every 10 seconds it should display the updated values corresponding to a label.

 

I will attach the screenshot for a better understanding of the query.

 

I want a use case where,

Temp1(label) corresponds to 26 (value)

After 10s,

Temp2 (label) corresponds to 18 (value) 

After 10s,

Temp 3 (label) corresponds to 5 (value) and so on.

 

The panel has to be updated automatically after the specified time interval. Kindly provide a solution if the query is clear.

 

Thanks in Advance.

 

Regards,

Airin

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for confirming. I do have a work around to achieve something similar to what you seek. Please try the below steps:

  • Create a property of type String under your Thing entity which has the property you are binding to the label on the Mash Up. 
  • Now create a service as below:
var result = me.Test; //Test is the property bound to the label on the Mash up
//TempValue is the string created to withhold the values
if(me.TempValue !== '') {
    me.TempValue = result +" "+ me.TempValue;
}
else{
    me.TempValue = ""+result;
}
result = me.TempValue;
  • Create a similar service for the other property that you intend to bind to the other label. The above service ensures that the newly read values are displayed on the top of the scroll bar.
  • Invoke this service on the MashUp with an auto refresh widget and bind the output to the label.

Please let me know if you have any questions with the implementation.

View solution in original post

5 REPLIES 5

Hi Airin,

 

Could you provide more inputs on how you achieved the scrolling panel? From the image you have attached, it appears that you placed a label widget inside a panel. The scroll appears because the text assigned to the label inside the panel has grown out of the label and panel height. Please correct me if I am wrong.

 

Best regards,

Rajesh.

Hi Rajesh,

 

Yes, your assumption is right. 

For the time being, I placed a label inside the panel to give an idea how the entries should look like.

 

What I really want to achieve is, a dynamically changing name field and corresponding value field inside a scroll panel. 

If that's possible, kindly help me with a solution.

 

Thank you for your time.

 

Best Regards,

Airin

Hi Airin,

Thanks for confirming. I have a work around to achieve your functionality. But, it becomes hard to keep track of the one to one correspondence as the list/values grows. Please follow the below steps to achieve this: 

  • Create a new property of type String under your Thing entity which has the property that you are binding to the label.
  • Create a service as below.
var result = me.Test; //Test is the property name you would be binding to the label 
//Tempvalue is a property of type string added to the Thing
if(me.TempValue !== '') { me.TempValue = result +" "+ me.TempValue; }
else{ me.TempValue = result; }
result = me.TempValue;
  • The above service makes sure that the updated value/newly read value is displayed on the top of the label.
  • Create a similar service for other property that you intend to bind to the label.
  • Now, bind the service to the Auto refresh widget on the mash up and link the output of the service to the label.

Please let me know if you have any questions in the implementation.

Best regards,

Rajesh.

Thanks for confirming. I do have a work around to achieve something similar to what you seek. Please try the below steps:

  • Create a property of type String under your Thing entity which has the property you are binding to the label on the Mash Up. 
  • Now create a service as below:
var result = me.Test; //Test is the property bound to the label on the Mash up
//TempValue is the string created to withhold the values
if(me.TempValue !== '') {
    me.TempValue = result +" "+ me.TempValue;
}
else{
    me.TempValue = ""+result;
}
result = me.TempValue;
  • Create a similar service for the other property that you intend to bind to the other label. The above service ensures that the newly read values are displayed on the top of the scroll bar.
  • Invoke this service on the MashUp with an auto refresh widget and bind the output to the label.

Please let me know if you have any questions with the implementation.

Please note that even with the solution provided, it would be hard to maintain one-one correspondence as the data set grows too large too soon. Keep you mind that you intend to update the value every 10 seconds. I would recommend introducing a counter in the service in such a way that the list would store only 10 sets of reads. This way, your one-one correspondence becomes little manageable.

 

Best regards,

Rajesh.

 

Top Tags