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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Can I call a Thing service from the Custom CSS of a Mashup?

AndyHilton
13-Aquamarine

Can I call a Thing service from the Custom CSS of a Mashup?

Is it possible to call a Thing service from the Custom CSS of a mashup?  If so, how?

 

Example:

.label .widget-ptcslabel::part(label) {
     display: Things["Thing"].service({

                   ProcessOrderNo: ProcessOrderNo /* STRING */});
}

ACCEPTED SOLUTION

Accepted Solutions
jensc
17-Peridot
(To:AndyHilton)

Hello,

 

Better late then never.

 

From what I know this is not possible no.

If you want to do something based on a service, you would have to use mashup functions like an expression or use a service to return a string with which custom CSS class to use.

Something like:

 

if (useClass1) {
   output = 'class1';
} else if (useClass2) {
   output = 'class2';
}

 

And then just bind this output to your customClass property on the widget you want to target.

It is a little cumbersome I agree, but as we can't use jQuery or similar in functions, this is the only way I know how.

 

Regards,

Jens

View solution in original post

1 REPLY 1
jensc
17-Peridot
(To:AndyHilton)

Hello,

 

Better late then never.

 

From what I know this is not possible no.

If you want to do something based on a service, you would have to use mashup functions like an expression or use a service to return a string with which custom CSS class to use.

Something like:

 

if (useClass1) {
   output = 'class1';
} else if (useClass2) {
   output = 'class2';
}

 

And then just bind this output to your customClass property on the widget you want to target.

It is a little cumbersome I agree, but as we can't use jQuery or similar in functions, this is the only way I know how.

 

Regards,

Jens

Announcements


Top Tags