[SailfishDevel] Access elements in a SilicaListView header

Sylvain B. sthocs at hotmail.com
Mon Feb 16 19:57:54 UTC 2015


Hi,
I'd like to put a SearchField into the header of a SilicaListView, but I figured out that I can't access it from outside (I want to clear the text when the user refreshes the model).
The code below will trigger a "ReferenceError: searchField is not defined":

Page {
    SilicaListView {
        anchors.fill: parent

        PullDownMenu {
            MenuItem {
                text: qsTr("Update search field")
                onClicked: { searchField.text = "hi" }
            }
        }

        header : SearchField {
            id: searchField
            width: parent.width
            placeholderText: "Filter"
        }
    }
}

Any idea?
Thanks.
 		 	   		  


More information about the Devel mailing list