Monday, 9 September 2013

trying to solve problems to load tabs accordingly to tag values

trying to solve problems to load tabs accordingly to tag values

I´ve posted here the final part of my head plus the body code generated in
my application.
The idea is to load tabs or not and make them visible and enabled
accordingly to values of tags of my c# application.
I use sharpkit to convert expression plus some treatment on my software. I
didn´t find a reason why I couldn´t do that.If I remove my code and just
put simple values it works fine, but I really need to make it work with
the script code.
<script>
var J = jQuery.noConflict(true);
</script>
<form>
//object configuration
<div class="ui-tabs" id="Graphics3Tab1" style=
"position:absolute;overflow: hidden;top:24px; left:28px; width:638px;
height:631px; z-index:-1;">
<ul class="ui-tabs-nav">
<li>
<a href="#itemGraphics1"><span>Graphics1</span></a>
</li>
<li>
<a href="#itemGraphics2"><span>Graphics2</span></a>
</li>
<li>
<a href="#itemGraphics4"><span>Graphics4</span></a>
</li>
</ul>
<div id="itemGraphics1" style=
"position: absolute;top: 15%; bottom: 0; right: 0; left: 0;
height:77%;z-index:-5;overflow-x:hidden;overflow-y:hidden;">
</div>
<div id="itemGraphics2" style=
"position: absolute;top: 15%; bottom: 0; right: 0; left: 0;
height:77%;z-index:-5;overflow-x:hidden;overflow-y:hidden;">
</div>
<div id="itemGraphics4" style=
"position: absolute;top: 15%; bottom: 0; right: 0; left: 0;
height:77%;z-index:-5;overflow-x:hidden;overflow-y:hidden;">
</div>
</div>
</form>
<script>
//treat enabled/disabled on beginning
J(document).ready(function() {
J(function(){
{
//scripttag is a function to treat the value of the tag to the browser

if((ScriptTagValuesBoolean[GetKey("Tags/NewTag10;0")]).toString().toUpperCase()
== 'FALSE' ||
(ScriptTagValuesBoolean[GetKey("Tags/NewTag10;0")]).toString().toUpperCase()
== '0'){
J(Graphics3Tab1).tabs( "disabled" ,0);}
if((ScriptTagValuesBoolean[GetKey("Tags/NewTag9;0")]).toString().toUpperCase()
== 'FALSE' ||
(ScriptTagValuesBoolean[GetKey("Tags/NewTag9;0")]).toString().toUpperCase()
== '0'){
J(Graphics3Tab1).tabs( "disabled" ,1);}
J(Graphics3Tab1).tabs( "disabled" ,2);
};
//load tabs
J(function()
{
J('#itemGraphics1').load("Graphics1.html");
});
J(function()
{
J('#itemGraphics2').load("Graphics2.html");
});
J(function()
{
J('#itemGraphics4').load("Graphics4.html");
});
});
//function to treat visibility and enabled/disable if tag change/update value
function Expr_itemGraphics1_Visible()
{
if((ScriptTagValuesBoolean[GetKey("Tags/NewTag7;0")]).toString().toUpperCase()
== 'FALSE' ||
(ScriptTagValuesBoolean[GetKey("Tags/NewTag7;0")]).toString().toUpperCase()
== '0'){
J('#itemGraphics1').css('visibility','hidden');
J('#itemGraphics1').css('pointer-events','none');
}
else{
J('#itemGraphics1').css('visibility','visible');
Expr_Graphics1_Enabled();
}
}
AddExpressionToList('Expr_itemGraphics1_Visible,Tags/NewTag7;0');
function Expr_Graphics1_Enabled()
{
if((ScriptTagValuesBoolean[GetKey("Tags/NewTag10;0")]).toString().toUpperCase()
== 'FALSE' ||
(ScriptTagValuesBoolean[GetKey("Tags/NewTag10;0")]).toString().toUpperCase()
== '0'){
J('#itemGraphics1').css('pointer-events','none');
J('#itemGraphics1').attr('disabled', 'disabled');
}
else{
J('#itemGraphics1').css('pointer-events','auto');
J('#itemGraphics1').removeAttr('disabled');
}
}
AddExpressionToList('Expr_Graphics1_Enabled,Tags/NewTag10;0');
</script>

No comments:

Post a Comment