Embedded forms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Embedded forms

Ron Teitelbaum
Hi,

It appears that if I render a component that has a form inside it onto
another form that buttons for the main form only work above the embedded
component.

I have a component which contains a form, a table and some buttons.

Form
Table
Buttons

I embed this component in another form

html form

       html render: myComponent.


If I put my button before the rendered component it all seems to work.

html form
        html submitButton

        html render: myComponent

But if I put my button under the component that has its own form then the
button does not work.

html form
        html render: myComponent

        html submitButton

In both cases it appears that the embedded component form is working just
fine, all the buttons work.  But on the parent form it only works if the
button comes before the embedded form.  

Am I doing something wrong, is there a way to get both forms working
properly with the button coming after the embedded component?

Thanks for your help!

Ron Teitelbaum

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Embedded forms

Pavel Krivanek-2
On 11/18/06, Ron Teitelbaum <[hidden email]> wrote:

> Hi,
>
> It appears that if I render a component that has a form inside it onto
> another form that buttons for the main form only work above the embedded
> component.
>
> I have a component which contains a form, a table and some buttons.
>
> Form
> Table
> Buttons
>
> I embed this component in another form
>
> html form
>
>        html render: myComponent.
>
>
> If I put my button before the rendered component it all seems to work.
>
> html form
>         html submitButton
>
>         html render: myComponent
>
> But if I put my button under the component that has its own form then the
> button does not work.
>
> html form
>         html render: myComponent
>
>         html submitButton
>
> In both cases it appears that the embedded component form is working just
> fine, all the buttons work.  But on the parent form it only works if the
> button comes before the embedded form.
>
> Am I doing something wrong, is there a way to get both forms working
> properly with the button coming after the embedded component?

Look here: http://www.squeaksource.com/ShoreComponents.html
(ShoreComponents-3-pk.2.mcz)
It contains a solution of this problem. Nested forms are not valid in HTML.

-- Pavel
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Embedded forms

Michel Bany
In reply to this post by Ron Teitelbaum
> It appears that if I render a component that has a form inside it onto
> another form that buttons for the main form only work above the  
> embedded
> component.
>

Ron,

As a Seaside application is getting more complex, I noticed that it gets
hurt with two typical unanticipated issues that break XHTML compliance
- nested forms
- duplicate id.
That's why I created the package named SeasideAssistants.

Below, I am supplying the package description in VW.

HTH
Michel.



Among other things, proper compliance to XHTML implies
(1) Form tags are not be nested,
(2) The id attribute values are unique.
The later is especially important when using AJAX techniques where it  
is critical for the Javascript functions to uniquely identify the XML  
elements that are manipulated.
In complex constructs that are using many nested components generated  
by many different rendering methods from many different classes, it  
may be difficult to ensure XHTML compliance. As a consequence, nested  
form tags or duplicate id attribute values are likely to occur.
This package slightly modifies Seaside so that nested form tags and  
duplicate id attribute values are producing an error. This makes it  
possible to immediately and precisely spot where to look in the  
Seaside application.
The exact behavior is decided in the following methods :
        #shouldRaiseDuplicateCssIdErrors
        #shouldRaiseNestedFormErrors
        #shouldSilentlyDiscardNestedForms
These methods are available in classes WAHtmlRenderer and  
WARenderCanvas.
When this package is loaded the default behavior is the following:
(1) Duplicate id attribute values are allowed  
(#shouldRaiseDuplicateCssIdErrors answers false)
(2) Nested form tags are allowed (#shouldRaiseNestedFormErrors  
answers false)
(3) Nested form tags are silently discarded  
(#shouldSilentlyDiscardNestedForms answers true)
This default behavior ensures that an existing Seaside application  
does not break.
To enable a different behavior, there are two possibilities.
(1) Modifies any of the six methods listed above
(2) Subclass WAHtmlRenderer or WARenderCanvas and re-implement  
methods as needed

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Embedded forms

Ron Teitelbaum
In reply to this post by Pavel Krivanek-2
Thanks Pavel,

I started looking at shore components previously but got sidetracked.  I was
thinking about contributing some widgets that I've been building.  When I
get a chance to package them up should I send them to you?  Is there another
preferred way to contribute, like say mantis?

Thanks for the hint on nested forms from what I saw it was just a div tag
when a form is embedded which seems pretty interesting.  

Ron

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Pavel Krivanek
> Sent: Saturday, November 18, 2006 2:57 AM
> To: [hidden email]; The Squeak Enterprise Aubergines Server - general
> discussion.
> Subject: Re: [Seaside] Embedded forms
>
> On 11/18/06, Ron Teitelbaum <[hidden email]> wrote:
> > Hi,
> >
> > It appears that if I render a component that has a form inside it onto
> > another form that buttons for the main form only work above the embedded
> > component.
> >
> > I have a component which contains a form, a table and some buttons.
> >
> > Form
> > Table
> > Buttons
> >
> > I embed this component in another form
> >
> > html form
> >
> >        html render: myComponent.
> >
> >
> > If I put my button before the rendered component it all seems to work.
> >
> > html form
> >         html submitButton
> >
> >         html render: myComponent
> >
> > But if I put my button under the component that has its own form then
> the
> > button does not work.
> >
> > html form
> >         html render: myComponent
> >
> >         html submitButton
> >
> > In both cases it appears that the embedded component form is working
> just
> > fine, all the buttons work.  But on the parent form it only works if the
> > button comes before the embedded form.
> >
> > Am I doing something wrong, is there a way to get both forms working
> > properly with the button coming after the embedded component?
>
> Look here: http://www.squeaksource.com/ShoreComponents.html
> (ShoreComponents-3-pk.2.mcz)
> It contains a solution of this problem. Nested forms are not valid in
> HTML.
>
> -- Pavel
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Embedded forms

Ron Teitelbaum
In reply to this post by Michel Bany
Hi Michel,

You know I saw that earlier but forgot all about it.  I'd loaded up your
stuff before but I think I unloaded it as a way to trying and debug the
nbsp; problem earlier.  I'll take a look!  

Thanks,

Ron

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Michel Bany
> Sent: Saturday, November 18, 2006 3:55 AM
> To: [hidden email]; The Squeak Enterprise Aubergines Server - general
> discussion.
> Subject: Re: [Seaside] Embedded forms
>
> > It appears that if I render a component that has a form inside it onto
> > another form that buttons for the main form only work above the
> > embedded
> > component.
> >
>
> Ron,
>
> As a Seaside application is getting more complex, I noticed that it gets
> hurt with two typical unanticipated issues that break XHTML compliance
> - nested forms
> - duplicate id.
> That's why I created the package named SeasideAssistants.
>
> Below, I am supplying the package description in VW.
>
> HTH
> Michel.
>
>
>
> Among other things, proper compliance to XHTML implies
> (1) Form tags are not be nested,
> (2) The id attribute values are unique.
> The later is especially important when using AJAX techniques where it
> is critical for the Javascript functions to uniquely identify the XML
> elements that are manipulated.
> In complex constructs that are using many nested components generated
> by many different rendering methods from many different classes, it
> may be difficult to ensure XHTML compliance. As a consequence, nested
> form tags or duplicate id attribute values are likely to occur.
> This package slightly modifies Seaside so that nested form tags and
> duplicate id attribute values are producing an error. This makes it
> possible to immediately and precisely spot where to look in the
> Seaside application.
> The exact behavior is decided in the following methods :
> #shouldRaiseDuplicateCssIdErrors
> #shouldRaiseNestedFormErrors
> #shouldSilentlyDiscardNestedForms
> These methods are available in classes WAHtmlRenderer and
> WARenderCanvas.
> When this package is loaded the default behavior is the following:
> (1) Duplicate id attribute values are allowed
> (#shouldRaiseDuplicateCssIdErrors answers false)
> (2) Nested form tags are allowed (#shouldRaiseNestedFormErrors
> answers false)
> (3) Nested form tags are silently discarded
> (#shouldSilentlyDiscardNestedForms answers true)
> This default behavior ensures that an existing Seaside application
> does not break.
> To enable a different behavior, there are two possibilities.
> (1) Modifies any of the six methods listed above
> (2) Subclass WAHtmlRenderer or WARenderCanvas and re-implement
> methods as needed
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Embedded forms

Pavel Krivanek-2
In reply to this post by Ron Teitelbaum
Hi Ron,

On 11/18/06, Ron Teitelbaum <[hidden email]> wrote:
> Thanks Pavel,
>
> I started looking at shore components previously but got sidetracked.  I was
> thinking about contributing some widgets that I've been building.  When I
> get a chance to package them up should I send them to you?  Is there another
> preferred way to contribute, like say mantis?

The best way how to contribute is the SqueakSource repository - simply
publish the next version or create some experimental package.

> Thanks for the hint on nested forms from what I saw it was just a div tag
> when a form is embedded which seems pretty interesting.

...and the attributes of nested forms like associated JavaScripts are
delegated on parent form.

-- Pavel

>
> > -----Original Message-----
> > From: [hidden email] [mailto:seaside-
> > [hidden email]] On Behalf Of Pavel Krivanek
> > Sent: Saturday, November 18, 2006 2:57 AM
> > To: [hidden email]; The Squeak Enterprise Aubergines Server - general
> > discussion.
> > Subject: Re: [Seaside] Embedded forms
> >
> > On 11/18/06, Ron Teitelbaum <[hidden email]> wrote:
> > > Hi,
> > >
> > > It appears that if I render a component that has a form inside it onto
> > > another form that buttons for the main form only work above the embedded
> > > component.
> > >
> > > I have a component which contains a form, a table and some buttons.
> > >
> > > Form
> > > Table
> > > Buttons
> > >
> > > I embed this component in another form
> > >
> > > html form
> > >
> > >        html render: myComponent.
> > >
> > >
> > > If I put my button before the rendered component it all seems to work.
> > >
> > > html form
> > >         html submitButton
> > >
> > >         html render: myComponent
> > >
> > > But if I put my button under the component that has its own form then
> > the
> > > button does not work.
> > >
> > > html form
> > >         html render: myComponent
> > >
> > >         html submitButton
> > >
> > > In both cases it appears that the embedded component form is working
> > just
> > > fine, all the buttons work.  But on the parent form it only works if the
> > > button comes before the embedded form.
> > >
> > > Am I doing something wrong, is there a way to get both forms working
> > > properly with the button coming after the embedded component?
> >
> > Look here: http://www.squeaksource.com/ShoreComponents.html
> > (ShoreComponents-3-pk.2.mcz)
> > It contains a solution of this problem. Nested forms are not valid in
> > HTML.
> >
> > -- Pavel
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside