Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Manajemen Properti
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

OWL lifecycle

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
portalOWLodoo17CE
1 Balas
3306 Tampilan
Avatar
Raudel

In odoo 17. 

I have the following problem: 

I have a component (MYCOMPONENT), which has in its .xml a Notebook (WEB component) with only 2 pages. In the "onMounted" of MYCOMPONENTE i need to make visual modifications to elements that are within each of the Notebook pages, since that information is dynamic in terms of styles and visual details.

It turns out that when I open my page in the browser with one of the Notebook pages displayed or active, everything is fine, but when I start interacting with this interface (Notebook pages) the information that I updated in "onMounted" is no longer there. The pages are as originally planned in the .xml, and I am referring to the visual information, as well as what I added from the UI.


thank

0
Avatar
Buang
Avatar
CodeWasher
Jawaban Terbai

In Odoo 17, which uses the OWL (Odoo Web Library) framework, the issue you're encountering seems related to the lifecycle of the OWL components, specifically with the interaction between the onMounted hook and how the Notebook component re-renders its pages.


When you interact with a Notebook (such as switching tabs), OWL might re-render the content inside the Notebook, which can reset the DOM modifications you made in the onMounted hook. Since OWL's rendering process is reactive, it can re-apply the original state as defined in your component's template when the component re-renders.


Solution

To ensure that your dynamic styles and modifications persist even after interacting with the Notebook, you need to use a combination of OWL's lifecycle hooks and event listeners to apply these changes every time the Notebook re-renders or changes pages.


Here’s how you can approach it:


1. Use the onPatched Lifecycle Hook

The onPatched lifecycle hook can be used to reapply the modifications whenever the component is re-rendered.


2. Handle Notebook Tab Change

You should also ensure that your styles are reapplied when the user switches between Notebook tabs. You can do this by adding an event listener for the Notebook tab changes.


3. Ensure that the CSS selectors you use to target elements inside the Notebook pages are precise and correctly reference the elements you want to modify. The this.el.querySelector method searches within the component’s root element, so make sure the selectors match the structure of your Notebook component.

0
Avatar
Buang
Raudel
Penulis

thank for the answer, i wil testing notebook tab change event

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Le Pattern "Reactive Dialog Service" (OWL 2)
OWL
Avatar
0
Apr 26
10
ValueError: Expected singleton: res.partner() when I try to give Portal Access to a customer Diselesaikan
portal
Avatar
Avatar
2
Jan 26
2238
Trying to replace default “Invoices & Bills” breadcrumb in Odoo portal
portal
Avatar
Avatar
1
Nov 25
1745
Dynamically update cart icon after adding products from a reorder popup in Custom Odoo portal
portal
Avatar
Avatar
1
Nov 25
1643
Skills needed for Odoo OWL Development ?
OWL
Avatar
Avatar
Avatar
2
Sep 25
4158
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Karir
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now