You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by th...@apache.org on 2005/11/03 16:58:00 UTC

svn commit: r330572 - in /lenya/trunk/src: modules/cforms/usecases/dynamicrepeater_template.xml webapp/lenya/usecases/usecases.js

Author: thorsten
Date: Thu Nov  3 07:57:54 2005
New Revision: 330572

URL: http://svn.apache.org/viewcvs?rev=330572&view=rev
Log:
Changed cform code that it is possible to use a cancel button.

Modified:
    lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
    lenya/trunk/src/webapp/lenya/usecases/usecases.js

Modified: lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml?rev=330572&r1=330571&r2=330572&view=diff
==============================================================================
--- lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml (original)
+++ lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml Thu Nov  3 07:57:54 2005
@@ -30,7 +30,7 @@
       <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
       <input type="hidden" name="lenya.usecase"
         value="${request.getParameter('lenya.usecase')}"/>
-      <input type="hidden" name="lenya.submit" value="ok"/>
+      <input type="hidden" id="lenya.submit" name="lenya.submit" value="ok"/>
       <p>
         This is an example of how dynamic templates (using the JX macros) allow to change the
         page structure depending on the form contents. By adding or removing rows in the repeater
@@ -101,7 +101,9 @@
       </div>
       </ft:repeater>
       <ft:widget id="ok"/>
+      <!-- If you want a cancel button you beware to change the lenya.submit value!!! like: -->
       <br/>
+      <input i18n:attr="value" type="submit" name="cancel" value="Cancel" onClick="document.getElementById('lenya.submit').value='cancel'"/>
     </ft:form-template>
   </page:body>
 </page:page>

Modified: lenya/trunk/src/webapp/lenya/usecases/usecases.js
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/usecases.js?rev=330572&r1=330571&r2=330572&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/usecases/usecases.js (original)
+++ lenya/trunk/src/webapp/lenya/usecases/usecases.js Thu Nov  3 07:57:54 2005
@@ -217,7 +217,7 @@
                 passRequestParameters(flowHelper, usecase);
                 usecase.advance();
                 //HEADSUP: Cform do not allow id="submit" anymore. Use id="ok" for now (till it is settled on cocoon-dev).
-                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit")) {
+                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit"!="cancel")) {
                     usecase.checkExecutionConditions();
                     if (! usecase.hasErrors()) {
                        if (view.getViewType()=="cforms"){



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Re: svn commit: r330572 - in /lenya/trunk/src: modules/cforms/usecases/dynamicrepeater_template.xml webapp/lenya/usecases/usecases.js

Posted by Thorsten Scherler <th...@apache.org>.
El vie, 04-11-2005 a las 09:04 +0100, Felix Röthenbacher escribió:
> Hi Thorsten
> 
> what does
> 
> +                if 
> (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit"!="cancel")) 
> {
> 
> mean? Is there a ')' missing?
> 

wow

thx for spotting this.

Should have been:
cocoon.request.getParameter("lenya.submit")!="cancel")

Will fix that now.

salu2
> - Felix
> 
> 
> thorsten@apache.org wrote:
> > Author: thorsten
> > Date: Thu Nov  3 07:57:54 2005
> > New Revision: 330572
> > 
> > URL: http://svn.apache.org/viewcvs?rev=330572&view=rev
> > Log:
> > Changed cform code that it is possible to use a cancel button.
> > 
> > Modified:
> >     lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
> >     lenya/trunk/src/webapp/lenya/usecases/usecases.js
> > 
> > Modified: lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
> > URL: http://svn.apache.org/viewcvs/lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml?rev=330572&r1=330571&r2=330572&view=diff
> > ==============================================================================
> > --- lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml (original)
> > +++ lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml Thu Nov  3 07:57:54 2005
> > @@ -30,7 +30,7 @@
> >        <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
> >        <input type="hidden" name="lenya.usecase"
> >          value="${request.getParameter('lenya.usecase')}"/>
> > -      <input type="hidden" name="lenya.submit" value="ok"/>
> > +      <input type="hidden" id="lenya.submit" name="lenya.submit" value="ok"/>
> >        <p>
> >          This is an example of how dynamic templates (using the JX macros) allow to change the
> >          page structure depending on the form contents. By adding or removing rows in the repeater
> > @@ -101,7 +101,9 @@
> >        </div>
> >        </ft:repeater>
> >        <ft:widget id="ok"/>
> > +      <!-- If you want a cancel button you beware to change the lenya.submit value!!! like: -->
> >        <br/>
> > +      <input i18n:attr="value" type="submit" name="cancel" value="Cancel" onClick="document.getElementById('lenya.submit').value='cancel'"/>
> >      </ft:form-template>
> >    </page:body>
> >  </page:page>
> > 
> > Modified: lenya/trunk/src/webapp/lenya/usecases/usecases.js
> > URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/usecases.js?rev=330572&r1=330571&r2=330572&view=diff
> > ==============================================================================
> > --- lenya/trunk/src/webapp/lenya/usecases/usecases.js (original)
> > +++ lenya/trunk/src/webapp/lenya/usecases/usecases.js Thu Nov  3 07:57:54 2005
> > @@ -217,7 +217,7 @@
> >                  passRequestParameters(flowHelper, usecase);
> >                  usecase.advance();
> >                  //HEADSUP: Cform do not allow id="submit" anymore. Use id="ok" for now (till it is settled on cocoon-dev).
> > -                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit")) {
> > +                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit"!="cancel")) {
> >                      usecase.checkExecutionConditions();
> >                      if (! usecase.hasErrors()) {
> >                         if (view.getViewType()=="cforms"){
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: commits-help@lenya.apache.org
> > 
> > 
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: svn commit: r330572 - in /lenya/trunk/src: modules/cforms/usecases/dynamicrepeater_template.xml webapp/lenya/usecases/usecases.js

Posted by Felix Röthenbacher <fe...@wyona.com>.
Hi Thorsten

what does

+                if 
(cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit"!="cancel")) 
{

mean? Is there a ')' missing?

- Felix


thorsten@apache.org wrote:
> Author: thorsten
> Date: Thu Nov  3 07:57:54 2005
> New Revision: 330572
> 
> URL: http://svn.apache.org/viewcvs?rev=330572&view=rev
> Log:
> Changed cform code that it is possible to use a cancel button.
> 
> Modified:
>     lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
>     lenya/trunk/src/webapp/lenya/usecases/usecases.js
> 
> Modified: lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml
> URL: http://svn.apache.org/viewcvs/lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml?rev=330572&r1=330571&r2=330572&view=diff
> ==============================================================================
> --- lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml (original)
> +++ lenya/trunk/src/modules/cforms/usecases/dynamicrepeater_template.xml Thu Nov  3 07:57:54 2005
> @@ -30,7 +30,7 @@
>        <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
>        <input type="hidden" name="lenya.usecase"
>          value="${request.getParameter('lenya.usecase')}"/>
> -      <input type="hidden" name="lenya.submit" value="ok"/>
> +      <input type="hidden" id="lenya.submit" name="lenya.submit" value="ok"/>
>        <p>
>          This is an example of how dynamic templates (using the JX macros) allow to change the
>          page structure depending on the form contents. By adding or removing rows in the repeater
> @@ -101,7 +101,9 @@
>        </div>
>        </ft:repeater>
>        <ft:widget id="ok"/>
> +      <!-- If you want a cancel button you beware to change the lenya.submit value!!! like: -->
>        <br/>
> +      <input i18n:attr="value" type="submit" name="cancel" value="Cancel" onClick="document.getElementById('lenya.submit').value='cancel'"/>
>      </ft:form-template>
>    </page:body>
>  </page:page>
> 
> Modified: lenya/trunk/src/webapp/lenya/usecases/usecases.js
> URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/usecases.js?rev=330572&r1=330571&r2=330572&view=diff
> ==============================================================================
> --- lenya/trunk/src/webapp/lenya/usecases/usecases.js (original)
> +++ lenya/trunk/src/webapp/lenya/usecases/usecases.js Thu Nov  3 07:57:54 2005
> @@ -217,7 +217,7 @@
>                  passRequestParameters(flowHelper, usecase);
>                  usecase.advance();
>                  //HEADSUP: Cform do not allow id="submit" anymore. Use id="ok" for now (till it is settled on cocoon-dev).
> -                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit")) {
> +                if (cocoon.request.getParameter("submit")||cocoon.request.getParameter("lenya.submit"!="cancel")) {
>                      usecase.checkExecutionConditions();
>                      if (! usecase.hasErrors()) {
>                         if (view.getViewType()=="cforms"){
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
> For additional commands, e-mail: commits-help@lenya.apache.org
> 
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org