Page 1 of 1

Event in PHP

Posted: Mon Jul 22, 2019 4:01 pm
by kaveh
Hello,
i need to execute some codes on BeforePrint event.
when i put something like : alert("hello"); it works perfectly
but when i put : Text2.Text="hello"; it doesn't work, no errors, nothing
is there any way to add some lines of codes on BeforePrint of an object.

Thanks

Re: Event in PHP

Posted: Mon Jul 22, 2019 11:19 pm
by HighAley
Hello.

Please, write the name of the property starting the small letter.

Code: Select all

Text1.text="hello"; 
This code works.

Thank you.

Re: Event in PHP

Posted: Tue Jul 23, 2019 7:58 am
by kaveh
I really appreciate for your response.
you're right, i thought that it's like the .Net designer.
anyway, how is the syntax for html5 designer, i use JS for php and calling the designer from code.
for example i need some calculation and then move an image. here is my codes:

double mean=1.11;
double min=mean*0.85;
double max=mean*1.25;
double value=score1; //comment : score1 is a variable

double left=0;

if(value>min && value<max)
{
left=barGray1.left+(value-min)*barGray1.width/(max-min)-arrow1.width/2;
}
else if (value>max)
{ left=barGreen1.left+barGreen1.width/3-arrow1.width/2;
}
else if (value<min)
{ left=barGray1.left-barRed1.width/3-arrow1.width/2;
}


lblScore1.left=left;

thanks you very much

Re: Event in PHP

Posted: Wed Jul 24, 2019 7:38 am
by Lech Kulikowski
Hello,

Unfortunately, the code in events in the JS version is not supported. Only limited operations may be used.

Thank you.

Re: Event in PHP

Posted: Thu Jul 25, 2019 7:04 am
by kaveh
Hello,
actually i guess it's supported, but in java language. i found the solution. just to share with the others :
/////////////////////
var mean=1.11;
var min=mean*0.85;
var max=mean*1.25;
var value=score1;
var left=0;

if(value>min && value<max)
{
left=barGray1.left+(value-min)*barGray1.width/(max-min)-arrow1.width/2;
}
else if (value>max)
{ left=barGreen1.left+barGreen1.width/3-arrow1.width/2;
}
else if (value<min)
{ left=barGray1.left-barRed1.width/3-arrow1.width/2;
}
arrow1.left=left;
/////////////////
thanks

Re: Event in PHP

Posted: Thu Jul 25, 2019 7:56 am
by Lech Kulikowski
Hello,

Thank you for the provided solution.

Thank you.

Re: Event in PHP

Posted: Wed Jul 31, 2019 10:26 am
by kaveh
Hello,
in html5 designer (js), i could use Variables in the events like below : (value is predefined variable in dictionary)
value="2333";
Text41.text=value;

this works but how can i use field names like: value=ds1.pName;
even: value={ds1.pName}; didn't work for me.
could you please help me?

Thank you.

Re: Event in PHP

Posted: Sun Aug 04, 2019 2:30 pm
by Lech Kulikowski
Hello,

Unfortunately, the code in events in the JS version is not supported. Only limited operations may be used.

Thank you.