Help forum

how to reload component info from Attributes?

  • unicodes

    1 year ago

    I have two components at the same level (like Cities and Countries). I need to refresh the Cities content based on the selected Country. Cities and Countries are two separate components with external variables (passing information using Attributes and Events to facilitate usage across different pages).

    Even when selecting a new Country and deleting the selectedCity variable content, the visible value doesn't change. Even though I have set "On Attribute Change" inside the component to pass the value from the Attribute to the internal variable again, it still doesn't update. However, if I hide and show the component, it works; otherwise, it doesn’t.

    I'm more than 100% sure that the value is deleted as expected, but I can't understand why it isn't taking the new value from the input again.
    1341496687935623209-Screenshot_2025-02-18_at_21.43.14.png
    1341496688627421355-Screenshot_2025-02-18_at_21.43.35.png
    1341496689634181221-Screenshot_2025-02-18_at_21.47.21.png
  • Lucas G

    1 year ago

    Does it work on frontend?
  • Is it just the context not updating inside the editor or does it not work at all
  • unicodes

    1 year ago

    In the editor and in browser it doesn't work. The values are editing right in the variables, but doesn't want to update visually. Only if refreshing the component (like opening a new page and coming back on the previous with that component).
  • Lucas G

    1 year ago

    Is it possible to see the project/component
  • unicodes

    1 year ago

    Do you mean to export it as web component and sharing it or making a video?
  • Lucas G

    1 year ago

    Like a link to the project, but a video with more info would work as well
  • We would need to see how it's all setup
  • unicodes

    1 year ago

    Hi Lucas, I continue to get this issue so I come back with a new case more simple to explain.
    1343978852212281557-Screenshot_2025-02-25_at_18.11.34.png
  • I have a component and I'm passing information in using attributes. The variable selected get's the attribute value and the <p> shows the content of the variable.
  • My issue is that this does not shows the information in the <p> tag if not reloading the component itself.
  • unicodes

    1 year ago

    I can use the event "on attribute change", but it should get the value directly considering the variable selected has already this connection with the attribute.
  • unicodes

    1 year ago

    This is the path of how the information is passed.
    1343980166468079627-Screenshot_2025-02-25_at_18.17.01.png
  • unicodes

    1 year ago

    The event edit click add information in a variable. If the information exist then is true in the switch which turns the component (editor) on.
  • The editor get the value from the variable agreement, and pass the information to the child intended for using attributes.