Property getter was expecting a Textbox component but got a YailList instead

219 views
Skip to first unread message

Enora Nedelec

unread,
Mar 28, 2015, 2:06:20 PM3/28/15
to mitappinv...@googlegroups.com
I have read several threads about this error on the forum but, the proposed solutions didn't work for me (and there were too old, so I couldn't post my question there). 

I have several textboxes that I would like to checked before saving then in TinyDB. The text of those textboxes should not contain the "|" and the "✯" char. 

If I voluntary add a ✯ in one of this field and click on my save buttin,, then the "then" condition is apply (cf the blue arrow on my printscreen) but I am getting this error message: Property getter was expecting a Textbox component but got a YailList instead

I have try using the "add item to list" block and also the "make a list" block but both give me the same error. 



Thanks a lot for your help! 

SteveJG

unread,
Mar 28, 2015, 3:23:27 PM3/28/15
to mitappinv...@googlegroups.com
Do a DoIt on the  set TextBox.BackgroundColor ....the one were it indicates the_txtboxchecked.   I bet that is a list ... simply disable that block and see if your code runs.

Taifun

unread,
Mar 28, 2015, 3:30:48 PM3/28/15
to mitappinv...@googlegroups.com
as far as I can see, the screenhot looks fine
I don't think, the error is in that part of the screenshot...

for easier understanding of your blocks, let me recommend to rename your variables like this
component instead of the_txtbox_checked
listTextboxes instead of All_Txtboxes
textboxText instead of txt_Of_the_Txtbox_alert_if_forbidden_char

you can try to disable the complete for each in list loop, does the error still occur?
in case this does not help, you might want to provide a creenshot of the complete procedure
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Enora Nedelec

unread,
Mar 29, 2015, 4:15:33 AM3/29/15
to mitappinv...@googlegroups.com
Thanks Steve and Taifun for your help! You were actually both right: The error came from another "for each" were... I add a list where it was asked a component. I didn't pay attention to that for each because I thought I was blocking the acces to that second for each with my variable "Frobidden_Char_checker_allow_to_save" set to false. But that was a mistake: a single txtbox that didn't contain a forbidden character, will set that variable to true. So I change the way the variable is set and now it's allowing the access to the second  "for each" only if all the txtboxes are clear! 

I try a DoIt as recommended by Steve on the set "TextBox.BackgroundColor" block and I get this error (red warning triangle): "Error from Companion: Property setter was expecting a TextBox component but got a Package instead".
But now I am sure it's a component that I linked to the block and not a list (I have renamed my variables as recommended by Taifun, thanks for that!) and when I try it on the emulator, the backgroundcolor of my txtboxes changes as expected. Any idea why I get this error?

Taifun

unread,
Mar 29, 2015, 10:31:12 AM3/29/15
to mitappinv...@googlegroups.com
I try a DoIt as recommended by Steve on the set "TextBox.BackgroundColor" block and I get this error (red warning triangle): "Error from Companion: Property setter was expecting a TextBox component but got a Package instead".

you can't use Do it with local variables
Taifun

Enora Nedelec

unread,
Mar 29, 2015, 11:34:32 AM3/29/15
to mitappinv...@googlegroups.com
Well this is a really good thing to know! Knowing that will save me so much time: I've spent hours trying to debug local variable with Do It.Well the good news is: I won't waste more of my time on that, thanks to you, Taifun. This advice is really precious!
Reply all
Reply to author
Forward
0 new messages