Reference Decorations and New Fuji Icons

Dan Alexander1
Mega Expert

Hi Folks,

We're scheduled to move our instance to Fuji in November, and in our current development to identify bugs and issues with the upgrade, I've come across an issue with Reference Decorations and UI Macros.

In Dublin (Current) - we were using code like the following:

<g:reference_decoration id="${jvar_n}" field="${ref}"

  onclick="showRelatedList('${ref}'); "

  title="${gs.getMessage('Show related incidents')}" image="images/icons/tasks.gifx"/>

In Fuji - we've learned there is a new button class/library for icons - and found some revised code online, swapping out reference_decoration for an 'a' tag.

<a>

<span

  id="${jvar_n}"

  onclick="showRelatedList('${ref}')"

  name="${jvar_n}"

  aria-label="${HTML:gs.getMessage('Show related incidents')}"

  title="${gs.getMessage('Show related incidents')}"

  alt="${gs.getMessage('Show related incidents')}"

  class="icon ref-button icon-add btn btn-default btn-ref">

</span>

</a>

While this works, we've noticed the functionality is different. For example, since the move to the 'a' tag, the icon is ALWAYS visible. Even if no value is filled out in that reference field. So my question is, in Fuji -- is reference_decoration no longer supported? If it IS supported still, how do you leverage the new icon classes? If it IS NOT supported - how do we re-add the functionality back to only show visible when a value is set.

Thanks all!

Dan
Harvard University

1 ACCEPTED SOLUTION

Masha
Kilo Guru

Yes. It is supported. All of the OOTB ui macros will function as before. There is a piece of javascript that toggles the icon. Look for 'show_related_records' or task_show_ci_map UI Macros for doctype in a Fuji instance and they will give you an example of how that functionality is leveraged.


View solution in original post

6 REPLIES 6

Hi Daniel,



Is that first snippet from your UI Macro 'reference_decoration' ? Here is what my UI Macro code looks like:



<a id="${jvar_id}" name="${jvar_id}" onclick="${jvar_onclick}" style="display: none" class="reference_decoration">


  <span title="${jvar_title}" alt="${jvar_title}" class="${jvar_class}" />



Previously the class= was hard coded above.



Now I can pass a class into the macro above, see example below:



<g:reference_decoration id="${jvar_n}" field="${ref}"


  onclick="clearCurrentAssignments('${ref}'); "


  title="${gs.getMessage('Clear the current assigned to and assigned group')}" class="btn btn-default btn-ref icon-workflow-rejected"/>



Let me now if that helps!



-Dan


Hi Dan,



The <span> tag doesn't come in the Fuji upgrade, correct me if I am wrong? I can see the span tag in my Personal "Helsinki" instance.



Do you mean we would have to add the <span> tag?



I just have the below in our instance:



  <a id="${jvar_id}" name="${jvar_id}"


      onclick="${jvar_onclick}"


      style="visibility: hidden" class="reference_decoration btn btn-default">


  <img border="0" src="${jvar_image}" title="${jvar_title}" alt="${jvar_title}"/>


</a>