Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CQ5 open dialog on page load

Tags:

extjs

aem

I have a cq page with a component included by using <cq:include />

I would like to get the included component dialog open on the page load, rather than waiting for author to double click on the component area.

Thank you, Sri

like image 209
Sri Avatar asked Feb 08 '23 20:02

Sri


1 Answers

this is something i had done when i want to open dialog

<script type="text/javascript">
<% if (((String)properties.get(configuration.getInherited("connectedWhen", "username"), "")).trim().equals("")) { %>
CQ.WCM.onEditableReady("<%= resource.getPath() %>", function(editable){
    CQ.wcm.EditBase.showDialog(editable);
}, this);
<% } %>
</script>

or if you want a more clean code try this :

CQ.WCM.onEditableReady("<%= resource.getPath() %>", function(editable){
    CQ.wcm.EditBase.showDialog(editable);
}, this);

Hope it'll help.. :)

like image 144
Manisha Avatar answered Feb 22 '23 23:02

Manisha