Screens - jumps, drop down order
-
hi,
is it possible to jump to another screen via a click button?
also, of the available screens, the list appears to be in the order of creation... can i sort this alphabetically? or as i see fit?
thanks
Neil
-
Look at HTML, you can use something like this to create a custom drop down list
<SCRIPT TYPE="text/javascript"> <!-- function dropdown(mySel) { var myWin, myVal; myVal = mySel.options[mySel.selectedIndex].value; if(myVal) { if(mySel.form.target)myWin = parent[mySel.form.target]; else myWin = window; if (! myWin) return true; myWin.location = myVal; } return false; } //--> </SCRIPT> <FORM METHOD=POST onSubmit="return dropdown(this.gourl)"> <SELECT NAME="gourl"> <OPTION VALUE="">Choose a Destination... <OPTION VALUE="http://localhost/views.shtm?viewId=2">View 2 <OPTION VALUE="http://localhostviews.shtm?viewId=3">View 3 <OPTION VALUE="http://localhost/views.shtm?viewId=4">View 4 </SELECT> <INPUT TYPE=SUBMIT VALUE="Go"> </FORM>
-
and here there is a button
<FORM> <INPUT TYPE="BUTTON" VALUE="View 2" ONCLICK="window.location.href='http://localhost/views.shtm?viewId=2'"> </FORM>
I also would like to know if there is some script to use a datapoint value to decide if the option will be enabled or not.
-
You could use a server-side script component to conditionally present the button.
-
Yes, I've already realized that but actually I'm the PLC guy and got no clues on how to create this conditional button with 'onClick' event in pure javascript
Could you please post some example?
-
Create a Server-side script, select the point on which displaying the button depends. This script should give you the idea:
return value == 0 ? "" : "button";With the code above, if the selected point is 0 nothing is displayed, otherwise a button text is displayed.
Regards,
Greg -
nice but it do not works with html links or buttons, how can I create a link button there?
-
the problem was solved, need to supress the "" from the html code.
-
It may be an issue for server-script component
I used the property "disabled" in a button and saved the view.
When I try to edit the view, this component is also disabled.
So I need to enable the button using the datapoint logic to enable the component editing on the view.