ฉันประสบปัญหา โดยที่ส่วนประกอบบนเพจไม่รีเฟรช แม้ว่าฉันจะกำหนด EditListenersConfig ในไฟล์ edit_config ก็ตาม ไม่มีข้อผิดพลาดในคอนโซลของเซิร์ฟเวอร์หรือในเว็บเบราว์เซอร์ ฉันเดาว่า clientlibs บางประเภทไม่ได้โหลด แต่ฉันไม่พบวิธีแก้ปัญหาใด ๆ นอกจากทุกคนที่บอกให้ฉันกำหนดค่า editListeners ส่วนที่แปลกที่สุดคือ ในหน้าอื่นๆ บนเซิร์ฟเวอร์เดียวกัน มันทำงานได้ดี
ส่วนประกอบของหน้า AEM / CQ ไม่รีเฟรช / อัปเดตหลังจากเพิ่ม แก้ไข ลบ
คำตอบ (1)
ปรากฎว่าฉันพลาดไลบรารีไคลเอนต์บางตัวในหน้าของฉัน ดังนั้น หากใครก็ตามที่มีปัญหาเดียวกัน ให้เพิ่มบรรทัดต่อไปนี้ใน customheaderlibs.html ในองค์ประกอบของหน้า:
<sly data-sly-use.wcmInit="/libs/wcm/foundation/components/page/initwcm.js"
data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html">
<sly data-sly-call="${clientlib.css @ categories='aem-demo-bundle.main,aem-demo-bundle.dependencies'}"/>
<sly data-sly-test.templateCategories="${wcmInit.templateCategories}"
data-sly-call="${clientLib.css @ categories=templateCategories}" />
</sly>
<sly data-sly-include="author.html" />
และสร้างไฟล์ชื่อ author.html ในโฟลเดอร์เดียวกันและเพิ่มดังต่อไปนี้ รหัส:
<sly
data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}"
data-sly-call="${clientLib.all @ categories='cq.authoring.page'}" />
<sly data-sly-call="${clientLib.all @ categories='cq.wcm.edit'}" />
<sly data-sly-test="${!wcmmode.disabled}" data-sly-call="${clientLib.all @ categories='cq.wcm.foundation-main'}" />
<sly data-sly-test="${!wcmmode.disabled}" data-sly-call="${clientLib.all @ categories='cq.shared'}" />
person
Jan
schedule
14.04.2020