[Seaside] Accepting input from parent & child components
otto at finworks.biz
Tue Sep 8 17:09:05 UTC 2015
What you have here looks fine to me.
So the next thing I can think of do is to use the debugger to figure
out what is going on.
I would set a breakpoint in WACallbackRegistry >> handle:. This method
maps the names that are posted to the callbacks that are evaluated.
So, this will tell you firstly what fields are posted and then if they
map to the callback registry. If the field is not there, then you know
it is not coming through from the browser. If the callback is not
mapped, then we can try to figure that out from where the callback is
created. This is getting deep into Seaside though...
> 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`.
> 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
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside