You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2016/07/06 08:39:48 UTC

svn commit: r1751625 - in /tcl/rivet/branches/2.3: ChangeLog VERSION configure.ac doc/xml/commands.xml rivet/packages/form/form2.tcl

Author: mxmanghi
Date: Wed Jul  6 08:39:48 2016
New Revision: 1751625

URL: http://svn.apache.org/viewvc?rev=1751625&view=rev
Log:
    * doc/xml/commands.tcl: typo in section ::rivet::xml corrected
    * rivet/packages/form/form2.tcl: merging recent fix of the select
    element generation
    * configure.ac,VERSION: changing version to 2.3.2


Modified:
    tcl/rivet/branches/2.3/ChangeLog
    tcl/rivet/branches/2.3/VERSION
    tcl/rivet/branches/2.3/configure.ac
    tcl/rivet/branches/2.3/doc/xml/commands.xml
    tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl

Modified: tcl/rivet/branches/2.3/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/ChangeLog?rev=1751625&r1=1751624&r2=1751625&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/ChangeLog (original)
+++ tcl/rivet/branches/2.3/ChangeLog Wed Jul  6 08:39:48 2016
@@ -1,3 +1,9 @@
+2016-07-06 Massimo Manghi <mx...@apache.org>
+    * doc/xml/commands.tcl: typo in section ::rivet::xml corrected
+    * rivet/packages/form/form2.tcl: merging recent fix of the select
+    element generation
+    * configure.ac,VERSION: changing version to 2.3.2
+
 2016-06-16 Massimo Manghi <mx...@apache.org>
     * doc/xml/commands.xml: manual page for ::rivet::catch rewritten
     * Changelog: entry for 2.3.1 release corrected (the date was 

Modified: tcl/rivet/branches/2.3/VERSION
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/VERSION?rev=1751625&r1=1751624&r2=1751625&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/VERSION (original)
+++ tcl/rivet/branches/2.3/VERSION Wed Jul  6 08:39:48 2016
@@ -1 +1 @@
-2.3.1
+2.3.2

Modified: tcl/rivet/branches/2.3/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/configure.ac?rev=1751625&r1=1751624&r2=1751625&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/configure.ac (original)
+++ tcl/rivet/branches/2.3/configure.ac Wed Jul  6 08:39:48 2016
@@ -22,7 +22,7 @@ dnl
 # so you can encode the package version directly into the source files.
 #-----------------------------------------------------------------------
 
-AC_INIT([Rivet],[2.3.1])
+AC_INIT([Rivet],[2.3.2])
 TEA_INIT([3.9])
 
 # we are storing here the configure command line, as recursive

Modified: tcl/rivet/branches/2.3/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/doc/xml/commands.xml?rev=1751625&r1=1751624&r2=1751625&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.3/doc/xml/commands.xml Wed Jul  6 08:39:48 2016
@@ -364,16 +364,16 @@
                 implement a simple internal exception mechanism by 
                 returning a special error code so that execution is in turn handed down to the
                 <command>AbortScript</command> and eventually to <command>AfterEveryScript</command> (if any of them is 
-                defined). Any code calling one of these commands running under control of the core
+                defined). Any code calling one of these commands which runs under control of the
                 <command>::catch</command> command would need to do this chore itself, checking the error info and in case 
-                rethrow the error if it was originated by one of mod_rivet's exceptions calls. 
-                This is what <command>::rivet::catch</command> does, but by hiding the implementation
-                details provide a better and more compatibile way to handle this condition.
+                throw the error again if it had been originated by one of mod_rivet's exceptions calls. 
+                This is what <command>::rivet::catch</command> does hiding the implementation
+                details to provide a better and more compatibile way to handle this condition.                
 			</para>
 			
 			<note>
-				This command is not meant to replace the core command, thus it's notexported from the 
-                <command>::rivet</command> namespace and therefore has to be fully qualified.
+				This command is not meant to replace the core command, thus it's not exported from the 
+            <command>::rivet</command> namespace and therefore has to be fully qualified.
 			</note>
 	    </refsect1>
 
@@ -2070,7 +2070,7 @@ form_request end</programlisting>
                 Given a string and a variable number of tag descriptors return XML framgment made
                 by nesting the tags with the same hierarchical order they are listed on the command
                 line. The tag descriptors can be a one element list (the tag) or an odd-length list whose
-                first argument is the tag namme and the remaining elements are interpreted as 
+                first argument is the tag name and the remaining elements are interpreted as 
                 attribute name-attribute value pairs. 
             </para>
             <para>

Modified: tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl?rev=1751625&r1=1751624&r2=1751625&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl (original)
+++ tcl/rivet/branches/2.3/rivet/packages/form/form2.tcl Wed Jul  6 08:39:48 2016
@@ -15,12 +15,12 @@
 # limitations under the License.
 
 package require Itcl
+package provide form 2.1
 
-package provide form 2.0
-
-#
 # Rivet form class
 #
+#
+
 ::itcl::class form {
 
     constructor {args} {
@@ -61,6 +61,10 @@ package provide form 2.0
     protected method import_data {type name arrayName list} {
         upvar 1 $arrayName data
 
+        # we now guarantee an array, though empty, will exist
+
+        array set data {}
+
         #
         # If there are elements in the defaultArgs array for the
         # specified type, combine them with the list of key-value
@@ -557,19 +561,18 @@ package provide form 2.0
             set labels $values 
         }
 
-        # emit the selector
-        html "<select name=\"$name\" [argstring data]>"
-
-        # emit each label-value pair
+        # emit the selector with each label-value pair
+        # we adopt the style imposed by the ::rivet::xml command generating
+        # the innermost elements and then wrapping them up with the 'select' tag
+        set options_list {}
         foreach label $labels value $values {
             if {[info exists default_list] && $value in $default_list } {
-                set string "<option value=\"$value\" selected=\"selected\">"
+                lappend options_list [::rivet::xml $label [list option value $value selected selected]]
             } else {
-                set string "<option value=\"$value\">"
+                lappend options_list [::rivet::xml $label [list option value $value]]
             }
-            html "$string$label</option>"
         }
-        html "</select>"
+        puts [::rivet::xml [join $options_list "\n"] [list select name $name {*}[array get data]]]
     }
 
     #



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org