You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by werner <we...@gefi.at> on 2005/10/25 11:27:09 UTC

Multiple forms per page

Hi,

I know it is not possible to have multiple forms on one page using
cforms. Is there some kind of workaround? I would like to put a
search-field on every page of a website. The website contains also a lot
of other cforms.  So I would like to put a form with a searchfield (does
not need to be a cform) together with another form (this has to be a
cform) on one single page.  Has anybody tried this before?


Thx
Werner





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by Geert Josten <Ge...@daidalos.nl>.
I'm not that well into CForms, but I don't think it will be a (large) problem to add a non-cform 
form to every page and have it point to a totally different url than the cform... Might result in 
dangling continuations, but these will time-out eventually.

Could also add it to the cform itself, but that might be awkward...

HTH,
Geert

werner wrote:

> Hi,
> 
> I know it is not possible to have multiple forms on one page using
> cforms. Is there some kind of workaround? I would like to put a
> search-field on every page of a website. The website contains also a lot
> of other cforms.  So I would like to put a form with a searchfield (does
> not need to be a cform) together with another form (this has to be a
> cform) on one single page.  Has anybody tried this before?
> 
> 
> Thx
> Werner
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

-- 
Drs. G.P.H. Josten
Consultant



Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is 
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken 
wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by werner <we...@gefi.at>.
Am Dienstag, den 25.10.2005, 13:57 +0200 schrieb Sylvain Wallez:

> werner wrote:
> > Hi,
> >
> > I know it is not possible to have multiple forms on one page using
> > cforms. Is there some kind of workaround? I would like to put a
> > search-field on every page of a website. The website contains also a lot
> > of other cforms.  So I would like to put a form with a searchfield (does
> > not need to be a cform) together with another form (this has to be a
> > cform) on one single page.  Has anybody tried this before?
> >   
> 
> There are some parts of the client-side JavaScript libraries that may 
> prevent the use of multiple CForms in a single page (this will have to 
> be fixed soon with Ajax apps where the concept of "page" becomes blurred).



> But absolutely nothing prevents several other forms to exist on the 
> page. And your search field can very well post another URL.
> 
> The dangling continuations mentioned by Geert are not a problem, as they 
> will expire, just as they would if the user closed the browser window.
> 
> Sylvain
> 


Thank you for your responses. I will use a simple form for the search
field. So there should be no problem. 

Werner



Re: Multiple forms per page

Posted by werner <we...@gefi.at>.
I don't think this is a browser problem. Does your form template contain
the state widget?

<fi:state>
    <ft:widget id="tab-state" />
</fi:state>

I don't know it the state-widget is really obligatory, but there is at
least a javascript error if it does not exist.

Werner

Am Dienstag, den 13.12.2005, 16:24 +0100 schrieb Alessandro Vincelli:

> I have a problem in cocoon 2.1.8 with a tab form...
> 
> in Explorer no problem
> 
> in Firefox this error:
> Error: document.getElementById(state) has no properties
> Source File: ... /js/forms-lib.js Line: 180
> 
> in forms-libs.js
> 
> 
> function forms_showTab(tabgroup, idx, length, state) {
>      // Change state value
>      if (state.length > 0) {
>          document.getElementById(state).value = idx;
>      }
> ....
> 
> 
> Can you help me?
> 
> thanks in advance, Alessandro
> 
> 
> 
> 
> -------------------------------
> Alessandro Vincelli
> W4B - web for business s.r.l.
> Firenze
> via Pellicceria 10 - 50123
> E-mail: a.vincelli@w4b.it
> tel: 055-2654270
> 
> 
> Sylvain Wallez ha scritto:
> > werner wrote:
> > 
> >> Yes, it's true. The tabs don't work when you have another form on the
> >> page. This problem can be solved if you change the line in forms-lib.js:
> >>
> >> document.forms[0][state].value = idx;
> >>
> >> to
> >>
> >> document.getElementById(state).value=idx;
> >>
> >> Then there is another change in the xsl necessary, because the tab-state
> >> widget is not generated with an id attribute (only with a name). In
> >> forms-page-styling.xsl look for the line
> >>
> >>  <input type="hidden" name="{$state-widget}"  value="{$active}"/>
> >>
> >> and add the id attribute
> >>
> >>  <input type="hidden" name="{$state-widget}" id="{$state-widget}"
> >> value="{$active}"/>
> >>
> >> Then it works. I don't know it this is a hack or not. As far as I have 
> >> seen, this problem exists in 2.1.7 and 2.1.8 (without
> >> Ajax)
> >>   
> > 
> > 
> > It will be in 2.1.8 :-)
> > 
> > Thanks for spotting this!
> > 
> > Sylvain
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

Fischer & Masik OEG
GEFi Informationstechnik und Datenservice
Reisenbauerring 5/1/12
A-2351 Wiener Neudorf

Tel: 02236 / 304 224
Fax: 02236 / 304 278
Mobil: 0676 528 97 57

Internet: http://www.gefi.at
e-mail:
persönlich: werner@gefi.at
allgemein: office@gefi.at


*************************
Confidentiality Notice
*************************
The information contained in this Email, and any attachments, is
intended for the named recipients only. It may contain confidential
and/or privileged information. If you are not the intended
recipient, you must not copy, distribute, or take any action in
reliance on it. Any views expressed do not necessarily reflect the
views of the company.

If you receive this Email by mistake, please advise the sender by
using the reply facility in your Email software and then delete it.




Re: Multiple forms per page

Posted by ia...@jpmchase.com.
Sounds like you're running into a variance between the IE and Firefox
object models.  For best performance, I would recommend restricting your
javascript to the DOM standard.

You can find the object model for MSIE here:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp

You can find the object model for Firefox here:
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference

You can find the JavaScript bindings for the DOM Level 2 Core can be found
here: http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html

Assuming state is the id of the element and idx is text content to be set
for that element, the following should work (untested) for both MSIE and
Firefox:

var stateElem = document.getElementById(state);
var oldContent = stateElem.getFirstChild();
var newContent document.createText(idx);
stateElem.replaceChild(newContent, oldContent);


HTH,
Ian

It's better to be hated for who you are
than loved for who you are not

Ian D. Stewart
Appl Dev Analyst-Advisory, DCS Automation
JPMorganChase Global Technology Infrastructure
Phone: (614) 244-2564
Pager: (888) 260-0078


                                                                                                                                       
                      Alessandro                                                                                                       
                      Vincelli                 To:       users@cocoon.apache.org                                                       
                      <a.vincelli@w4b.i        cc:                                                                                     
                      t>                       Subject:  Re: Multiple forms per page                                                   
                                                                                                                                       
                      12/13/2005 10:24                                                                                                 
                      AM                                                                                                               
                      Please respond to                                                                                                
                      users                                                                                                            
                                                                                                                                       





I have a problem in cocoon 2.1.8 with a tab form...

in Explorer no problem

in Firefox this error:
Error: document.getElementById(state) has no properties
Source File: ... /js/forms-lib.js Line: 180

in forms-libs.js


function forms_showTab(tabgroup, idx, length, state) {
     // Change state value
     if (state.length > 0) {
         document.getElementById(state).value = idx;
     }
....


Can you help me?

thanks in advance, Alessandro




-------------------------------
Alessandro Vincelli
W4B - web for business s.r.l.
Firenze
via Pellicceria 10 - 50123
E-mail: a.vincelli@w4b.it
tel: 055-2654270


Sylvain Wallez ha scritto:
> werner wrote:
>
>> Yes, it's true. The tabs don't work when you have another form on the
>> page. This problem can be solved if you change the line in forms-lib.js:
>>
>> document.forms[0][state].value = idx;
>>
>> to
>>
>> document.getElementById(state).value=idx;
>>
>> Then there is another change in the xsl necessary, because the tab-state
>> widget is not generated with an id attribute (only with a name). In
>> forms-page-styling.xsl look for the line
>>
>>  <input type="hidden" name="{$state-widget}"  value="{$active}"/>
>>
>> and add the id attribute
>>
>>  <input type="hidden" name="{$state-widget}" id="{$state-widget}"
>> value="{$active}"/>
>>
>> Then it works. I don't know it this is a hack or not. As far as I have
>> seen, this problem exists in 2.1.7 and 2.1.8 (without
>> Ajax)
>>
>
>
> It will be in 2.1.8 :-)
>
> Thanks for spotting this!
>
> Sylvain
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by Alessandro Vincelli <a....@w4b.it>.
I have a problem in cocoon 2.1.8 with a tab form...

in Explorer no problem

in Firefox this error:
Error: document.getElementById(state) has no properties
Source File: ... /js/forms-lib.js Line: 180

in forms-libs.js


function forms_showTab(tabgroup, idx, length, state) {
     // Change state value
     if (state.length > 0) {
         document.getElementById(state).value = idx;
     }
....


Can you help me?

thanks in advance, Alessandro




-------------------------------
Alessandro Vincelli
W4B - web for business s.r.l.
Firenze
via Pellicceria 10 - 50123
E-mail: a.vincelli@w4b.it
tel: 055-2654270


Sylvain Wallez ha scritto:
> werner wrote:
> 
>> Yes, it's true. The tabs don't work when you have another form on the
>> page. This problem can be solved if you change the line in forms-lib.js:
>>
>> document.forms[0][state].value = idx;
>>
>> to
>>
>> document.getElementById(state).value=idx;
>>
>> Then there is another change in the xsl necessary, because the tab-state
>> widget is not generated with an id attribute (only with a name). In
>> forms-page-styling.xsl look for the line
>>
>>  <input type="hidden" name="{$state-widget}"  value="{$active}"/>
>>
>> and add the id attribute
>>
>>  <input type="hidden" name="{$state-widget}" id="{$state-widget}"
>> value="{$active}"/>
>>
>> Then it works. I don't know it this is a hack or not. As far as I have 
>> seen, this problem exists in 2.1.7 and 2.1.8 (without
>> Ajax)
>>   
> 
> 
> It will be in 2.1.8 :-)
> 
> Thanks for spotting this!
> 
> Sylvain
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by Sylvain Wallez <sy...@apache.org>.
werner wrote:
> Yes, it's true. The tabs don't work when you have another form on the
> page. This problem can be solved if you change the line in forms-lib.js:
>
> document.forms[0][state].value = idx;
>
> to
>
> document.getElementById(state).value=idx;
>
> Then there is another change in the xsl necessary, because the tab-state
> widget is not generated with an id attribute (only with a name). In
> forms-page-styling.xsl look for the line
>
>  <input type="hidden" name="{$state-widget}"  value="{$active}"/>
>
> and add the id attribute
>
>  <input type="hidden" name="{$state-widget}" id="{$state-widget}"
> value="{$active}"/>
>
> Then it works. I don't know it this is a hack or not. 
> As far as I have seen, this problem exists in 2.1.7 and 2.1.8 (without
> Ajax)
>   

It will be in 2.1.8 :-)

Thanks for spotting this!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by werner <we...@gefi.at>.
Yes, it's true. The tabs don't work when you have another form on the
page. This problem can be solved if you change the line in forms-lib.js:

document.forms[0][state].value = idx;

to

document.getElementById(state).value=idx;

Then there is another change in the xsl necessary, because the tab-state
widget is not generated with an id attribute (only with a name). In
forms-page-styling.xsl look for the line

 <input type="hidden" name="{$state-widget}"  value="{$active}"/>

and add the id attribute

 <input type="hidden" name="{$state-widget}" id="{$state-widget}"
value="{$active}"/>

Then it works. I don't know it this is a hack or not. 
As far as I have seen, this problem exists in 2.1.7 and 2.1.8 (without
Ajax)

Werner



Am Dienstag, den 25.10.2005, 16:48 +0200 schrieb Josep A. Frau:
> En/na Sylvain Wallez ha escrit:
> 
> > werner wrote:
> >
> >> Hi,
> >>
> >> I know it is not possible to have multiple forms on one page using
> >> cforms. Is there some kind of workaround? I would like to put a
> >> search-field on every page of a website. The website contains also a lot
> >> of other cforms.  So I would like to put a form with a searchfield (does
> >> not need to be a cform) together with another form (this has to be a
> >> cform) on one single page.  Has anybody tried this before?
> >>   
> >
> >
> > There are some parts of the client-side JavaScript libraries that may 
> > prevent the use of multiple CForms in a single page (this will have to 
> > be fixed soon with Ajax apps where the concept of "page" becomes 
> > blurred).
> >
> > But absolutely nothing prevents several other forms to exist on the 
> > page. And your search field can very well post another URL.
> >
> If you use tabs presentation the js libraries use forms[0] in some 
> functions. If you have another form in the page the tabs don't work:
> 
> function forms_showTab(tabgroup, idx, length, state) {
>     // Change state value
>     if (state.length > 0) {
>         document.forms[0][state].value = idx;
>     }
> 
> I don't know if its used in any other place of the libraries.
> 
> > The dangling continuations mentioned by Geert are not a problem, as 
> > they will expire, just as they would if the user closed the browser 
> > window.
> >
> > Sylvain
> >
> 






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by "Josep A. Frau" <pe...@uib.es>.
En/na Sylvain Wallez ha escrit:

> werner wrote:
>
>> Hi,
>>
>> I know it is not possible to have multiple forms on one page using
>> cforms. Is there some kind of workaround? I would like to put a
>> search-field on every page of a website. The website contains also a lot
>> of other cforms.  So I would like to put a form with a searchfield (does
>> not need to be a cform) together with another form (this has to be a
>> cform) on one single page.  Has anybody tried this before?
>>   
>
>
> There are some parts of the client-side JavaScript libraries that may 
> prevent the use of multiple CForms in a single page (this will have to 
> be fixed soon with Ajax apps where the concept of "page" becomes 
> blurred).
>
> But absolutely nothing prevents several other forms to exist on the 
> page. And your search field can very well post another URL.
>
If you use tabs presentation the js libraries use forms[0] in some 
functions. If you have another form in the page the tabs don't work:

function forms_showTab(tabgroup, idx, length, state) {
    // Change state value
    if (state.length > 0) {
        document.forms[0][state].value = idx;
    }

I don't know if its used in any other place of the libraries.

> The dangling continuations mentioned by Geert are not a problem, as 
> they will expire, just as they would if the user closed the browser 
> window.
>
> Sylvain
>

-- 
Josep A. Frau <pe...@uib.es>
Centre de Tecnologies de la Informació
Universitat de les Illes Balears


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple forms per page

Posted by Sylvain Wallez <sy...@apache.org>.
werner wrote:
> Hi,
>
> I know it is not possible to have multiple forms on one page using
> cforms. Is there some kind of workaround? I would like to put a
> search-field on every page of a website. The website contains also a lot
> of other cforms.  So I would like to put a form with a searchfield (does
> not need to be a cform) together with another form (this has to be a
> cform) on one single page.  Has anybody tried this before?
>   

There are some parts of the client-side JavaScript libraries that may 
prevent the use of multiple CForms in a single page (this will have to 
be fixed soon with Ajax apps where the concept of "page" becomes blurred).

But absolutely nothing prevents several other forms to exist on the 
page. And your search field can very well post another URL.

The dangling continuations mentioned by Geert are not a problem, as they 
will expire, just as they would if the user closed the browser window.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org