[Seaside] Accepting input from parent & child components

Mark Bratcher mdbratch at gmail.com
Tue Sep 8 15:50:52 UTC 2015


>
>
> > By "recognize", I mean that I'm not seeing evidence that the callbacks
> for
> > changed fields in the child are being triggered.
>
> So if you set breakpoints in the callbacks, you are sure that they are
> not triggered?
>

I did not determine lack of callback via breakpoint, but had some trace
statements in my methods which were to be called and they did not print
(they print for the parent callbacks, but not the children).



>
> So I am hearing that you are using plain old subclasses of
> WAComponent? And you override #children in your subclass? And then
> #renderContentOn:?


I do have "plain" subclasses of WAComponent to an overall "MyAppComponent",
then all my app's components are subclassed from MyAppComponent. and I do
have `children` defined in my subclass and `renderContentOn`.
MyAppComponent provides a common set of small rendering helpers for
formatting, and loads common CSS files in `updateRoot` which the
subcomponents can capture via `super updateRoot: html`.


> What do you call to render your sub components?


> A better idea of your code structure or snippets of it may help.
>

Conceptually:


MyAppComponent subclass: ParentComponent [
    new [
        child := ChildComponent new
    ]

    children [ ^Array with: child ]

    initialize [
        super initialize.
        self addDecoration: (WAFormDecoration new buttons: self buttons).
    ]

    renderContentOn: html [
        "render parent items here..."

        html render: child
    ]

        ...

I can provide more specifics if needed.


>
> > I'm not sure how to determine the version of Seaside I have. I am using
> GNU
> > Smalltalk 3.2.91-b98173d, so it's whatever Seaside package revision
> they've
> > included with that.
>
> I have no idea how to check that with GNU; we're using
> Monticello/Metacello to load into Pharo and GemStone. And even in our
> environment it is difficult to figure out.
>
> >
> > Regards
> > Mark
> >
> >
> > On 9/8/2015 6:25 AM, Otto Behrens wrote:
> >>>
> >>> The parent input fields and subcomponent input fields are within the
> same
> >>> html `form`. However, when I click the submit button (done at the
> parent
> >>> level), only the input items rendered by the parent are recognized. Any
> >>> inputs provided by the user through the embedded, rendered subcomponent
> >>> are
> >>> ignored.
> >>
> >> I would carefully look at the HTML that you produce here. And then
> >> make sure I don't have nested forms. Remember that if you use Chrome
> >> (and I suspect Firefox and others too), the HTML you see with the
> >> "inspect element" menu does not give you the real HTML. Chrome removes
> >> nested forms. Make sure you look at the raw HTML.
> >>
> >> If you say "recognized" I assume you're talking about inputs posted
> >> with the submit, which translates into callbacks processed by Seaside.
> >> If so, your inputs are not in the same form tag or you have nested
> >> form tags.
> >>
> >>> Is it possible to do what I'm attempting to do?
> >>
> >> Yes, we're doing this a lot, so we can find out what's going on here.
> >>
> >> Cheers
> >> Otto
> >> _______________________________________________
> >> seaside mailing list
> >> seaside at lists.squeakfoundation.org
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150908/ab0e9e0c/attachment.htm


More information about the seaside mailing list