[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
What is the best way to do that?  XML
Forum Index » User help
Author Message
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
mlohbihler

Master
[Avatar]

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
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.
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 :

mlohbihler

Master
[Avatar]

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
 
Forum Index » User help
Go to:   
Powered by JForum 2.1.9 © JForum Team