I'm generating a list of links in an autocompleter
SearchComponent>>#renderContentOn script: (html autocompleter element: 'schoolTerm'; on: #renderSchoolListOn: of: self). SearchComponent>>#renderSchoolListOn list := SalesListMenuComponent new. (items first: (items size min: 10)) do: [:each | list addEntry: each schoolString withAction: [ self halt. each viewQueries ]]. The list renders fine, with links, but the action isn't being called when one is selected. I'm probably missing something completely obvious.... International Baccalaureate Steve Lloyd ICT Technical Analyst - Research Engineer Peterson House, Malthouse Ave. Cardiff Gate, CARDIFF CF23 8GL, United Kingdom Tel: +44 (0)2920 547869 | Fax: +44 (0)2920 547779 | Web: http://www.ibo.org_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Have a look at SUAutocompleterTest for a working example.
You shouldn't instantiate components while rendering, this will create a new instance with every request what is rarely what you want. Slime detects such problems. Lukas On Thu, Mar 19, 2009 at 4:48 PM, Steve Lloyd <[hidden email]> wrote: > I'm generating a list of links in an autocompleter > > SearchComponent>>#renderContentOn > > script: (html autocompleter > element: 'schoolTerm'; > on: #renderSchoolListOn: of: self). > > > SearchComponent>>#renderSchoolListOn > > list := SalesListMenuComponent new. > (items first: (items size min: 10)) > do: [:each | list > addEntry: each schoolString > withAction: [ self halt. each viewQueries ]]. > > The list renders fine, with links, but the action isn't being called when one is selected. > > I'm probably missing something completely obvious.... > > > International Baccalaureate Steve Lloyd ICT Technical Analyst - Research Engineer > Peterson House, Malthouse Ave. Cardiff Gate, CARDIFF CF23 8GL, United Kingdom > Tel: +44 (0)2920 547869 | Fax: +44 (0)2920 547779 | Web: http://www.ibo.org_______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks Lucas
I can see Slime is going to prove useful. I did start off with the example in SUAutocompleterTest, but in this case I'm not needing to do the triggerFormElement: on the textinput field, rather the generated dynamic list of matched strings have anchors which I then want to click on and invoke their actions. Steve International Baccalaureate Steve Lloyd ICT Technical Analyst - Research Engineer Peterson House, Malthouse Ave. Cardiff Gate, CARDIFF CF23 8GL, United Kingdom Tel: +44 (0)2920 547869 | Fax: +44 (0)2920 547779 | Web: http://www.ibo.org ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Lukas Renggli [[hidden email]] Sent: 19 March 2009 15:53 To: Seaside - general discussion Subject: Re: [Seaside] autocomplete lists of links Have a look at SUAutocompleterTest for a working example. You shouldn't instantiate components while rendering, this will create a new instance with every request what is rarely what you want. Slime detects such problems. Lukas On Thu, Mar 19, 2009 at 4:48 PM, Steve Lloyd <[hidden email]> wrote: > I'm generating a list of links in an autocompleter > > SearchComponent>>#renderContentOn > > script: (html autocompleter > element: 'schoolTerm'; > on: #renderSchoolListOn: of: self). > > > SearchComponent>>#renderSchoolListOn > > list := SalesListMenuComponent new. > (items first: (items size min: 10)) > do: [:each | list > addEntry: each schoolString > withAction: [ self halt. each viewQueries ]]. > > The list renders fine, with links, but the action isn't being called when one is selected. > > I'm probably missing something completely obvious.... > > > International Baccalaureate Steve Lloyd ICT Technical Analyst - Research Engineer > Peterson House, Malthouse Ave. Cardiff Gate, CARDIFF CF23 8GL, United Kingdom > Tel: +44 (0)2920 547869 | Fax: +44 (0)2920 547779 | Web: http://www.ibo.org_______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |