Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to open Touch UI Dialog box when a component is included in a template.

Avatar

Level 2

I have included a component on a template so its on every page by default. But am unable to open the component's dialog box in touch UI (AEM 6.2).

The browser is throwing 500 error for the below path :

http://localhost:4502/mnt/override/apps/test/components/content/global/menu/_cq_dialog.html/content/...

Any Idea how to handle this?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Afrem

     You can add a path property dynamically. I have implemented something similar for one of my project . Please find below the syntax. You have to first assign that to a variable

In the below code, I am trying to create parsys in loop and so I have to give different path properties.

Here is the explanation for @format

Ref :- cq5 - Expression Option Sightly - Stack Overflow

Hope this helps

Thanks

Veena

View solution in original post

10 Replies

Avatar

Level 5

is the edit dialog of this component is working properly if drag and dropped in page?

Avatar

Level 2

Yes.. Dialog is working properly if drag and drop in a page.

Avatar

Level 5

Hi Afrem,

I am not able to replicate the issue. Including component in template is working fine and I able to edit it and below is the path for getting dialog.html in browser

http://localhost:4502/libs/cq/gui/components/authoring/compat/content/dialog.html?dialog=%2Fapps%2Fs...

Can you share the sample content package with issue?

Avatar

Level 2

Hi Pooja,

This works fine in Classic UI. I am facing this issue in touch UI (_cq_dialog).

Avatar

Level 7

Hi Afrem Danaho,

I am not able to replicate this issue at my end.When a component is included in template I am able to edit the component dialog in page.

I have included the component using below syntax :

<div data-sly-resource="${'header' @ resourceType='/apps/aemsightly/components/content/header'}"></div>

Hope you have followed the same to include resource in page.If you can share a sample package of it we can better help you out in fixing this.

Thanks,

Techaspect Solutions.

Avatar

Level 2

Hi Techaspect,

Many Thanks,

I have include the component with 'dynamic path' with below syntax.

<div data-sly-resource="${@ path='pathretriever.path', resourceType='sampleproject/components/content/global/menu'}"></div>

to store the component configuration in a common node.

Dialog works fine in classic UI. But in touch UI it is not working.

Please find the below link which discuss the same issue.

Re: How to include component with dialog box on template with sightly?

Do we have any workaround for this?

Avatar

Level 10

To make this work in AEM - seems that this syntax is what you need:

<div data-sly-resource="${'header' @ resourceType='/apps/aemsightly/components/content/header'}"></div>

Looks like using dynamic path is not supported.

Avatar

Correct answer by
Community Advisor

Hi Afrem

     You can add a path property dynamically. I have implemented something similar for one of my project . Please find below the syntax. You have to first assign that to a variable

In the below code, I am trying to create parsys in loop and so I have to give different path properties.

Here is the explanation for @format

Ref :- cq5 - Expression Option Sightly - Stack Overflow

Hope this helps

Thanks

Veena

Avatar

Level 10

I tested this syntax --

<sly data-sly-test.par="${'core/wcm/components/list/v1/list'}" />

<div data-sly-resource="${@ path=par, resourceType='core/wcm/components/list/v1/list'}">

You can open the dialog --

listxxx.png

Avatar

Level 2

Many Thanks Veena and Scott .

The solution provided works for page level components.

My component is a global component and its configuration is same across all the pages. For that I am using the below syntax

<sly data-sly-resource="${@ path='/content/myproject/hidden',resourceType='myproject/components/content/global/menu'}"></sly>

This way my component configuration gets stored in the node - '/content/myproject/hidden' and is available across all the pages.

This works fine in classic UI.

But in case of touch UI, the dialog is not opening and I can see 500 error (in browser console) for the following URL

http://localhost:4502/mnt/override/apps/myproject/components/content/global/menu/_cq_dialog.html/con...

I am getting a NullPointerException while navigating through this URL.

Cannot serve request to /mnt/override/apps/myproject/components/content/global/menu/_cq_dialog.html/content/myproject/hidden in /libs/cq/gui/components/authoring/dialog/dialog.jsp

Exception:

java.lang.NullPointerException

  at org.apache.jsp.libs.cq.gui.components.authoring.dialog.dialog_jsp._jspService(dialog_jsp.java:348)

  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)

  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)

  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)

  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)

  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)

  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)

  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)

  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)

  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)

  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)

  at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:151)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:362)

  at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:177)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)

  at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)

  at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:114)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:381)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:155)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)

  at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:127)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:220)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:181)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:367)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:95)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.analytics.provisioning.impl.UserAuthenticationRequestFilter.doFilter(UserAuthenticationRequestFilter.java:119)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.mm.createpage.PageOrder.doFilter(PageOrder.java:116)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:285)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:74)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:107)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:77)

  at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:56)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:67)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServletStarterFilter.java:169)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:84)

  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)

  at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:216)

  at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)

  at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:89)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:290)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)

  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

  at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

  at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124)

  at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)

  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)

  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)

  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)

  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

  at org.eclipse.jetty.server.Server.handle(Server.java:499)

  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

  at java.lang.Thread.run(Thread.java:745)