This content has been marked as final. Show 9 replies
If your components have ids then you can access them with dot notation:
That is not true. I thought it would work that way but it does not. I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
which is basically where my error occurs.
Within the function, I have companyNotes_cmp.notesTitle_txt.text = "1213123"; companyNoted_cmp is the id of my component
Is the function public?
Yes it is, and everything else is fine within the function. I just cannot set an item within the component a value. :(
Are you trying to access the child before the parent has rendered the child? Can you post your code?
The code contains alot of other data, so I will try to explain it. The parent render the child when the from is first loaded.
In the function call, which is in the parent window. I have: companyNotes_cmp.notesTitle_txt.text = "123";
companyNotes_cmp is the ID of the component,
notesTitle_txt is the ID of the textfield within the component
Ah OK I got it figured out. Even though I had the component on screen, it was hidden within an accordian navigation object, therefore, the item has to be rendered on screen before it can be referenced
Thanks for all the input guys!
You can use the creationPolicy property of the Accordion to render all your children at the beginning.
Oh awesome, I like that :) Thanks for that point!!! :) :) :)