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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Anyway to apply some JS function to Value DIsplay widget?

ssrvsub
1-Newbie

Anyway to apply some JS function to Value DIsplay widget?

I know there is Expression Widget ​but it allows to do only simple things, so is there anyway to add function that will recive some data on input, process it, and then print it.

4 REPLIES 4

Client side: Expression Widget and Validator Widget ( with the second you can do less things ) .

Server side: you can build a service that does whatever you want with the data and return it back for the mashups.

mhollenbach
5-Regular Member
(To:ssrvsub)

Srvsub,

You could try writing a custom service and then adding it to the Mashup.This service could contain an input and output parameter and the logic you need to use to process the input. The result could then be bound to the Value Display Widget after it's processed by this service.

I'm not sure what your current Mashup looks like, but instead of binding a value directly to the Value Display Widget you would bind the value to the input parameter of this service, and then bind the output to the Value Display Widget.

Meghan

Thanks Megan, I've tried your advice and faced some problem.I attached a service(TestService) to thingTemplate with input(`rawData` - some string),output( `result` ) and logic inside. When I test it the values is ok and it works as intended. But when I try to use it in moshup input data is not passed to service.

I' add GetPropertyValues service and drag a a property from Returned Data->All Data->data to  TestService's parametres `rawData` then  I drag TestService's Returned Data->All Data->result to Value Display Widget. When I run moshup widget crossed with error icon and in log i have message that my input data is `undefined`.

It works if I add similar service directly to each thind and replcae input data with thing's property.

mhollenbach
5-Regular Member
(To:ssrvsub)

Is the GetPropertyValues service being exercised and returning property values before the TestService is exercised? I would bind the same property you are binding to the input of the TestService to a text box to make sure you are receiving the value you expect. The TestService should be exercised after the "ServiceInvokeCompleted" event of the GetPropertyValues service fires off.

Meghan

Top Tags