can any one help how to use less than operator in jelly script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2014 11:55 AM
Can any one help how to use less(<) operator in jelly script.
My problem is
<j:if test="${prob.percent_complete >=50}">
<svg height="100" width="100">
<circle cx="50" cy="50" r="5" stroke="black" stroke-width="1" fill="yellow"/>
</svg>
</j:if>
it is working fine. While implementing (less than)
<j:if test="${prob.percent_complete <50}">
<svg height="100" width="100">
<circle cx="50" cy="50" r="5" stroke="black" stroke-width="1" fill="yellow"/>
</svg>
</j:if>
it is not working.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2014 12:15 PM
Here is the wiki document for Escape codes for special characters using Jelly.
How to Escape in Jelly - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2014 12:51 PM
you can write < for < or <= for <=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2014 01:49 PM
That may not be displaying as intended. Replace a less than sign with the dollar sign, left bracket, "AMP", right bracket, "lt;".
Maybe this will show up right:
$[AMP]lt;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2014 11:33 PM
As per other comments.
The other way to approach this is to create a Script Include with those comparisons as functions, then your Jelly code becomes something like:
<g:evaluate>
var myOb = new ObScript();
</g:evaluate>
<j:if test="${myOb.halfDone(prob.percent_complete)}">
...