Hide/Show UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014 01:34 PM
I cant seem to find a way to Hide/Show a UI macro. Basicly, I want to hide a UI macro next to a field if that field is populated.
I tried style="visibility: hidden" which works, but I need it to be based on a condition.
also tried this
<a id="email" onclick="mailTo();">
<img border="0" style="visibility: visible" src="images/icons/email.gifx" title="Send 1st Internal Flash" alt="Send 1st Internal Flash"/>
</a>
<script>
if (gr.u_1st_flash_sent != ""){
var e = gel('${jvar_n}');
e.style.visibility= 'hidden';
}
</script>
the condition is: If the field is populated, the ui macro is hidden.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2014 09:28 AM
Can you have a client script that runs on change of the field and then finds the UI macro elements and sets style.display = 'none'. Or remove or add the UI macro entirely?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2014 11:43 AM
I figured it out using an onLoad client script. here is the code that I used.
if(fstFlash != ''){
var x = document.getElementById("fstEmail").style.visibility="hidden";
}
else{
var x = document.getElementById("fstEmail").style.visibility="visible";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2015 09:50 PM
Hi joseph,
There is a button next to caller field called "Show related incidents" which lists all related incidents of the user.I want to hide this butoon for the user to whom no incident is assigned.Please advice me how to do this.
Its a ui macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2014 01:22 PM
If this is on a Service Catalog page, the best way would be to create a container around the UI macro, and hide the container using g_form.setDisplay("<container_id>",false) based on the variable value. Let me know if that worked!