Hi,
I'm trying to get an HTML form working for a model object using Pharo 4 and Seaside 3. The model is a simple Address class with 3 instance variables: street, postCode and town. I have added the Magritte description methods like so: magritteDescriptionPostCode <magritteDescription> ^ MAStringDescription new accessor: #postCode; label: 'Postcode'; priority: 250; yourself The form is a subclass of WAComponent. It has the following method: renderContentOn: html ( Address new asComponent addValidatedForm: { #save -> 'Save'. #cancel -> 'Cancel' }; yourself ) renderContentOn: html The form displays in the browser but has no Save / Cancel buttons and the form tags are missing as well. What am I missing? Thanks for your help. _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi Rogier,
I think this might be all you need. renderContentOn: html html render: ( Address new asComponent addValidatedForm; yourself ) Hope it works for you :) Cheers, J > On 28 May 2015, at 8:40 am, Rogier Schaaf <[hidden email]> wrote: > > Hi, > > I'm trying to get an HTML form working for a model object using Pharo 4 and Seaside 3. > > The model is a simple Address class with 3 instance variables: street, postCode and town. I have added the Magritte description methods like so: > > magritteDescriptionPostCode > <magritteDescription> > ^ MAStringDescription new > accessor: #postCode; > label: 'Postcode'; > priority: 250; > yourself > > The form is a subclass of WAComponent. It has the following method: > > renderContentOn: html > ( Address new asComponent > addValidatedForm: { #save -> 'Save'. #cancel -> 'Cancel' }; > yourself ) renderContentOn: html > > The form displays in the browser but has no Save / Cancel buttons and the form tags are missing as well. > > What am I missing? > > Thanks for your help. > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Rogier Schaaf
On Wed, May 27, 2015 at 7:40 PM, Rogier Schaaf <[hidden email]> wrote:
mmm that code looks wrong. You should never send explicit #renderContentOn: Instead, you should use #render: renderContentOn: html html render: ( Address new asComponent addValidatedForm: { #save -> 'Save'. #cancel -> 'Cancel' }; yourself ) Did it change? Cheers,
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Thanks to both Mariano and Jupiter for your help. It works! On 27 May 2015 at 23:50, Mariano Martinez Peck <[hidden email]> wrote:
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |