Я пытаюсь обновить TextInput в kivy, когда я щелкаю SelectableLabel на RecycleView, но когда я печатаю self.ids
, он возвращает пустой dict, как я могу изменить текст TextInput, используя его идентификатор?
Код:
class SelectableLabel(RecycleDataViewBehavior, Label):
index = None
selected = BooleanProperty(False)
selectable = BooleanProperty(True)
def refresh_view_attrs(self, rv, index, data):
''' Catch and handle the view changes '''
self.index = index
return super(SelectableLabel, self).refresh_view_attrs(
rv, index, data)
def on_touch_down(self, touch):
''' Add selection on touch down '''
if super(SelectableLabel, self).on_touch_down(touch):
return True
if self.collide_point(*touch.pos) and self.selectable:
return self.parent.select_with_touch(self.index, touch)
def apply_selection(self, rv, index, is_selected):
''' Respond to the selection of items in the view. '''
self.selected = is_selected
if is_selected:
#print(rv.name)
if rv.name == 'search_table':
print(self.ids) # returns an empty string "{}", why?
else:
pass