<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Web UI won&amp;apos;t load overriden elements in chrome in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317839#M4840</link>
    <description>&lt;P&gt;I hope my solution worked as a temporary solution. However, I think this problem has been recenty solved with the new HotFix HF20&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2020 08:30:34 GMT</pubDate>
    <dc:creator>Rodri_</dc:creator>
    <dc:date>2020-01-07T08:30:34Z</dc:date>
    <item>
      <title>Web UI won&amp;apos;t load overriden elements in chrome</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317836#M4837</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I have come to notice that the web UI won't load the overriden elements in chrome if the network speed is slow. I tried changing the network speed from the dev tools to Fast 3G or slower. The interface will load only the default elements and leave aside any custom elements.&lt;/P&gt;
&lt;P&gt;I modified the document actions slots for the edit and delete document buttons with custom logic, this slots where added to a html file called my-custom-bundle.html:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;nuxeo-slot-content name="deleteDocumentAction" slot="DOCUMENT_ACTIONS" order="15"&amp;gt;
    &amp;lt;template&amp;gt;
        &amp;lt;my-delete-document-button document="[[document]]"&amp;gt;&amp;lt;/my-delete-document-button&amp;gt;
    &amp;lt;/template&amp;gt;
&amp;lt;/nuxeo-slot-content&amp;gt;

&amp;lt;nuxeo-slot-content name="deleteSelectionAction" slot="RESULTS_SELECTION_ACTIONS" order="30"&amp;gt;
    &amp;lt;template&amp;gt;
        &amp;lt;my-delete-documents-button documents="[[selectedItems]]"&amp;gt;&amp;lt;/my-delete-documents-button&amp;gt;
    &amp;lt;/template&amp;gt;
&amp;lt;/nuxeo-slot-content&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can see my components being loaded in the network tab, but if I examine the buttons from the ui they are just the default ones.&lt;/P&gt;
&lt;P&gt;Could this be a problem with my deployment fragment, or the require tag order?&lt;/P&gt;
&lt;P&gt;I share my deployment-fragment changes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;

&amp;lt;fragment version="1"&amp;gt;
    &amp;lt;extension target="application#MODULE"&amp;gt;
        &amp;lt;module&amp;gt;
            &amp;lt;java&amp;gt;${bundle.fileName}&amp;lt;/java&amp;gt;
        &amp;lt;/module&amp;gt;
    &amp;lt;/extension&amp;gt;
    &amp;lt;require&amp;gt;org.nuxeo.web.ui&amp;lt;/require&amp;gt;
    &amp;lt;require&amp;gt;all&amp;lt;/require&amp;gt;
    &amp;lt;install&amp;gt;
        &amp;lt;!-- unzip the war template --&amp;gt;
        &amp;lt;unzip from="${bundle.fileName}" to="/" prefix="web"&amp;gt;
            &amp;lt;include&amp;gt;web/nuxeo.war/**&amp;lt;/include&amp;gt;
            &amp;lt;exclude&amp;gt;web/nuxeo.war/ui/i18n/**&amp;lt;/exclude&amp;gt;
        &amp;lt;/unzip&amp;gt;
        &amp;lt;!-- create a temporary folder --&amp;gt;
        &amp;lt;delete path="${bundle.fileName}.tmp" /&amp;gt;-
        &amp;lt;mkdir path="${bundle.fileName}.tmp" /&amp;gt;
        &amp;lt;unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/&amp;gt;

        &amp;lt;copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/"/&amp;gt;
        &amp;lt;!-- append the translations --&amp;gt;
        &amp;lt;append from="${bundle.fileName}.tmp/web/nuxeo.war/ui/i18n/messages.json" to="nuxeo.war/ui/i18n/messages.json" addNewLine="true"/&amp;gt;
        &amp;lt;delete path="${bundle.fileName}.tmp"/&amp;gt;
    &amp;lt;/install&amp;gt;
&amp;lt;/fragment&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the component I declared to add the custom ui elements to the bundle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="studio.extensions.remove-button" version="1.0.0"&amp;gt;
    &amp;lt;require&amp;gt;org.nuxeo.web.ui.resources&amp;lt;/require&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.platform.WebResources" point="resources"&amp;gt;
        &amp;lt;resource name="delete-document" type="import" shrinkable="false"&amp;gt;
            &amp;lt;uri&amp;gt;/ui/my-delete-document-button.html&amp;lt;/uri&amp;gt;
        &amp;lt;/resource&amp;gt;
        &amp;lt;resource name="delete-documents" type="import" shrinkable="false"&amp;gt;
            &amp;lt;uri&amp;gt;/ui/delete-selected-docs-button.html&amp;lt;/uri&amp;gt;
        &amp;lt;/resource&amp;gt;
    &amp;lt;/extension&amp;gt;
    &amp;lt;extension target="org.nuxeo.ecm.platform.WebResources" point="bundles"&amp;gt;
        &amp;lt;bundle name="web-ui"&amp;gt;
            &amp;lt;resources append="true"&amp;gt;
                &amp;lt;resource&amp;gt;delete-document&amp;lt;/resource&amp;gt;
                &amp;lt;resource&amp;gt;delete-documents&amp;lt;/resource&amp;gt;
            &amp;lt;/resources&amp;gt;
        &amp;lt;/bundle&amp;gt;
    &amp;lt;/extension&amp;gt;
&amp;lt;/component&amp;gt;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Finally, this is my manifest file to include my contribution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Manifest-Version: 1.0
Bundle-Vendor: my.bundle.vendor
Bundle-Version: 1.0.0
Bundle-Name: ssa-tree
Bundle-ManifestVersion: 2
Require-Bundle: org.nuxeo.runtime
Bundle-SymbolicName: my.custom.bundle;singleton=true
Nuxeo-Component: OSGI-INF/extensions.xml,
  OSGI-INF/edit-permission-contrib.xml
Import-Package: org.nuxeo.ecm.core,
 org.slf4j,
 org.apache.avro

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there any other configuration missing or wrong?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;After some research, I found a jira ticket &lt;A href="https://jira.nuxeo.com/browse/ELEMENTS-1096"&gt;https://jira.nuxeo.com/browse/ELEMENTS-1096&lt;/A&gt; in which it explains it's most likely a bug with the chrome browser. Tested with firefox, even reducing network speed at maximum everything loads correctly unlike with chrome.&lt;/P&gt;
&lt;P&gt;Hopefully some fix will be released soon&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 20:10:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317836#M4837</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-09T20:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Web UI won&amp;apos;t load overriden elements in chrome</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317837#M4838</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;
&lt;P&gt;I have being rethinking about this issue, and after some tests I think I came up with a solution. Instead of overwriting the buttons, why don't you create a new one and then hide the default ones?
For example, with the delete button:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- Add your custom button --&amp;gt;
&amp;lt;nuxeo-slot-content name="myCustomdeleteDocumentAction" slot="DOCUMENT_ACTIONS" order="15"&amp;gt;
    &amp;lt;template&amp;gt;
        &amp;lt;my-delete-document-button document="[[document]]"&amp;gt;&amp;lt;/my-delete-document-button&amp;gt;
    &amp;lt;/template&amp;gt;
&amp;lt;/nuxeo-slot-content&amp;gt;

&amp;lt;!-- Disable the default delete button --&amp;gt;
&amp;lt;nuxeo-slot-content name="deleteDocumentAction" slot="DOCUMENT_ACTIONS" disabled&amp;gt;&amp;lt;/nuxeo-slot-content&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have tested this solution, and it worked pretty good. I also added a new more generic "require" tag in the bundle. This requirement is added when you generate the custom elements using Nuxeo Studio:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="studio.extensions.remove-button" version="1.0.0"&amp;gt;
    &amp;lt;require&amp;gt;org.nuxeo.runtime.started&amp;lt;/require&amp;gt;
	...
&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And finally, I have also seen you didn't import the custom elements in "my-custom-bundle.html". I think you forgot to add them only in this topic, but just in case, remember to add them:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;link rel="import" href="path/to/my-delete-document-button.html"&amp;gt;  
&amp;lt;link rel="import" href="path/to/my-delete-documents-button.html"&amp;gt;  
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this solution will help you.&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 10:52:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317837#M4838</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2019-12-28T10:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Web UI won&amp;apos;t load overriden elements in chrome</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317838#M4839</link>
      <description>&lt;P&gt;Thank you very much for your insight and suggested solution Rodri, this might work, I will try it out!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 18:05:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317838#M4839</guid>
      <dc:creator>a_c</dc:creator>
      <dc:date>2019-12-30T18:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Web UI won&amp;apos;t load overriden elements in chrome</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317839#M4840</link>
      <description>&lt;P&gt;I hope my solution worked as a temporary solution. However, I think this problem has been recenty solved with the new HotFix HF20&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 08:30:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/web-ui-won-apos-t-load-overriden-elements-in-chrome/m-p/317839#M4840</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2020-01-07T08:30:34Z</dc:date>
    </item>
  </channel>
</rss>

