Hi Mario, Just today I found a quite concrete example. Form for editing a record - with a 'has_many' relation. I need to load all the records from the related table as options to a SELECT - and then I would like to *set on all the options that correspond to records from the foreign table that currently related to the main record*. After that I would like to render the form.
This looks to me like a very standard need - and it is a good example of why you sometimes need to *alter the created options of a SELECT*. -- Zbyszek On 9/19/07, Zbigniew Lukasiak <[EMAIL PROTECTED]> wrote: > On 9/19/07, Mario Minati <[EMAIL PROTECTED]> wrote: > > On Wednesday 19 September 2007 14:56:16 Zbigniew Lukasiak wrote: > > > This argument gets a bit out of proportions - so I will not extend it. > > > > Didn't want to set you up. Generalising can get difficult (for me) without > > cases in (my) mind. > > > > Thanks Mario for your patience. I really like the 'search' and > 'where' attributes you introduced - this should make it quite general > solution and perhaps the change that I propose will not be needed by > anyone. But I'll try to explain myself once again. > > What I am trying to say is that it is easier to manipulate something > that you see then something unvisible. It is easier to manipulate the > Select element when you see it's options then when it does not have > any options but you know that at some point in the future they'll be > added. This is the same when you create the element by > 'load_config_file' and want to change it somehow via overriding a > method and when you create it 'by perl' and want to change it by > directly adding something to it 'by perl'. > > More directly: when you need to change some of the options - modify > them (set some of them 'on') or delete some of them or add some others > (like the 'choose country' option) you need to have access to them and > if they only appear at when the form is rendered this might be too > late. > > And another point - you are now overriding two methods - what I > propose is to override just one. > > Finally I found that populate is actually not called for every element > - and what should be overriden instead seems to be 'new' or perhaps > 'setup'. > > Cheers, > Zbyszek > -- Zbigniew Lukasiak http://brudnopis.blogspot.com/ _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu