| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 16/02/2010 14:37:35
|
Patriator
Initiate
Joined: 24/07/2009 03:58:32
Messages: 18
Offline
|
Got some datapoints for retrieving error codes ( int
Wish to offer a view with errors in plain text.
thought about using customview with a function let's say
String V(int code , String lang)
and in viewpoint something like :
if(value == "0") image = greenflag
else
image = redflag
out.println(V(value.parseInt() , lang));
but got an error saying that my function does not exist.
where/how can I declare my function?
on another hand,
Is there any way to declare 'transformation scripts' on datapoints in mango. Let's say ScriptA.
and then custom Datapoint as the result of applying ScriptA on another datapoint.
something like MetaDatasource or pointslink , but with the same script for all points.
No copy/Paste
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 16/02/2010 22:41:47
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1506
Offline
|
An easy way may be to define your points as multistate, and then create a text renderer that maps the states to text descriptions. Would that work for you?
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 17/02/2010 03:10:22
|
Patriator
Initiate
Joined: 24/07/2009 03:58:32
Messages: 18
Offline
|
Did not find the clue for using textrenderer.
Is there any exemple , doc ?
I guess that if I define a text renderer I'll be able to use it several times and that's exactly the point.
the other thing is that my points are from a modbus datasource... I'll have to create Meta-Points.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 17/02/2010 04:46:19
|
Patriator
Initiate
Joined: 24/07/2009 03:58:32
Messages: 18
Offline
|
Well I finally did it via CustomView ...
Things were easier once I realize that code I can add between <view:scriptPoint> and </view:scriptPoint> was the code for the
function(value, time) and should be in javascript.
So my code looks like that :
in a js file the declaration of my function.
in the jsp :
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 17/02/2010 09:45:16
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1506
Offline
|
Text renderers are assigned to points. Editing is found in the page with a "brick" icon that has a pencil on it.
Anyway, i'm glad that you were able to do this with a custom view. I had a feeling that users were more than willing to do their own scripting.
|
Best regards,
Matthew Lohbihler |
|
|
 |
|
|