question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'dialog' selector

See original GitHub issue

Hello again,

I’m wondering if this is using the ‘.dialog’ selector for the aem components.

I had an issue after installing SP1/SP2 in my AEM 6.1 servers. The React components disappears after editing (to be exact, their content disappears). This issue happen on the TouchUI edit window (editor.html). BTW, we’re using aem-react-0.4.0.

For example, I have a React text component. During editing, the editor calls the resource again with the ‘.dialog’ selector to rerender the content. In plain AEM 6.1 server, there is no ‘dialog’ selector being included, which works fine.

Sample url being called after edit is http://localhost:4502/content/test/home/jcr:content/structure/par/text_component.html?forceeditcontext=true&_=1489148319496 (no SP) and http://localhost:4502/content/test/home/jcr:content/structure/par/text_component.dialog.html?forceeditcontext=true&_=1489148319496 (SP1/SP2)

dialog-call

Rendered properly with .dialog selector

<div class="parbase text content">

	<div data-react-server="true" data-react="app" data-react-id="/content/test/home/jcr:content/structure/par/text_component">
		<span data-reactroot="" data-reactid="1" data-react-checksum="1190579901">
			<p data-reactid="2"><!-- react-text: 3 -->Sample text.<!-- /react-text --><br data-reactid="4"/><!-- react-text: 5 -->
			<!-- /react-text --></p><!-- react-text: 6 -->
			<!-- /react-text -->
		</span>
	</div>

<textarea id="/content/test/home/jcr:content/structure/par/text_component" style="display:none;">{&quot;cache&quot;:... other contents...}</textarea>
<cq data-path="/content/test/home/jcr:content/structure/par/text_component" data-config="{...}"></cq>
</div>

This is the source output with the ‘dialog’ selector

<div class="parbase text content">

<cq data-path="/content/test/home/jcr:content/structure/par/text_component" data-config="{....}"></cq>
</div>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
stemeycommented, Mar 13, 2017

I understand the problem now. I will look into a fix. Here are the two pieces of code that need to be changed:

https://github.com/sinnerschrader/aem-react/blob/master/core/src/main/java/com/sinnerschrader/aem/react/ReactScriptEngine.java#L90

https://github.com/sinnerschrader/aem-react/blob/master/core/src/main/java/com/sinnerschrader/aem/react/api/Sling.java#L263

I will look into a different mechanism to render the wrapper element only.

0reactions
stemeycommented, Mar 14, 2017

to get the wrapper element from AEM a request is dispatched to the component. In this request only the wrapper is rendered and the ReactScriptEngine renders nothing. To distinguish these two cases we used a dialog selector before and now we just set a request attribute. The request attribute is set to its old value in the above code snippet. That’s it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Dialog element - HTML: HyperText Markup Language
The HTML element represents a dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.
Read more >
Dialog Widget - jQuery UI API Documentation
While open, the dialog widget ensures that keyboard navigation using the 'tab' key causes the focus to cycle amongst the focusable ... Type:...
Read more >
Modifying the selector dialog box - IBM
Modifying the selector dialog box. You can show additional information (such as a user's email address, first name, and last name) in the...
Read more >
Configure Selector Dialog Box - MicroStrategy
Configure Selector Dialog Box · Apply selections as a filter: Determines whether the selector filters or slices the data. · Show option for...
Read more >
Overview of the Member Selector dialog box
You use the Member Selector dialog box, accessed via the Query Panel to visualize and select members in a hierarchy. You can work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found