:/ Thanks for trying. That's a good idea, experimenting with the label -- I've learned that I am way, way, way off on understanding the secret sauce.
On Jul 18, 6:05 pm, Montgomery Kosma <[email protected]> wrote: > Here's a bit of advice based on my learning experiences over the last > few weeks. Not sure it'll take you all the way there, but hope it's > at least directionally useful. > > The default form for User is defined in forms.dryml. > > <def tag="form" for="User"> > <form merge param="default"> > <error-messages param/> > <field-list fields="name, email_address, administrator" param/> > <div param="actions"> > <submit label="Save" param/><or-cancel param="cancel"/> > </div> > </form> > </def> > > You can override or augment this form in your application.dryml. > Consistent with DRY, the "hobo" way is to declare only what differs > from the default. > > Now, I'm assuming you've added birthday to the fields on the User > object. If so, then your default form (above) will include birthday > in the field-list line. (Otherwise, you would do something like this: > > <extend tag="form" for="User"> > <old-form merge> > <field-list: fields="name, email_address, administrator, > birthday"> > </old-form> > </extend> > ) > > But none of that should be necessary. Really, all you want to do is > override the input being used for the birthday field. To figure that > out, you have to look at the docs or the source for field-list in > rapid-core.dryml and see the params it defines. As you've noted, for > each field, it defines field-all:, field-label, field-view, field- > tag. So you should be able to do something like this: > > <extend tag="form" for="User"> > <old-form merge> > <birthday-view:> > <input ...> > </birthday-view:> > </old-form> > </extend> > > One suggestion, rather than first trying to get the input right, > experiment with something simpler like the label, e.g., <birthday- > label:>FOO!</birthday-label:> in the above will tell you straightaway > if you have the syntax correct, and let you separate out understanding > how to work with overriding the form elements from understanding how > to tweak the input being used for the date. > > On Jul 18, 8:15 pm, bryan <[email protected]> wrote: > > > (continued) > > > Anyway, this is what I'm currently trying (and I've tried lots of > > other stuff too). Please don't be too hard on me. > > > <extend tag="form" for="User"> > > <form merge> > > <field-list fields="name, email_address, administrator, birthday"> > > <birthday-view:> > > <input:birthday merge start-year="&Time.now.year - 100" > > end-year="&Time.now.year"/> > > </birthday-view:> > > </field-list> > > <div param="actions"> > > <submit label="Save" param/><or-cancel param="cancel"/> > > </div> > > </form> > > </extend> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
