Bhumi Thakkar (Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/mobile-client-bth-selection into 
lp:~openerp-dev/openerp-web/mobile-client.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/mobile-client-bth-selection/+merge/67921
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/mobile-client-bth-selection/+merge/67921
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openerp-web/mobile-client-bth-selection into 
lp:~openerp-dev/openerp-web/mobile-client.
=== modified file 'addons/web_mobile/static/src/js/chrome_mobile.js'
--- addons/web_mobile/static/src/js/chrome_mobile.js	2011-07-08 12:26:49 +0000
+++ addons/web_mobile/static/src/js/chrome_mobile.js	2011-07-14 06:48:33 +0000
@@ -130,14 +130,16 @@
 
         jQuery("#oe_header").children().remove();
         this.rpc("/base/session/get_databases_list", {}, function(result) {
+
             self.db_list = result.db_list;
             self.$element.html(QWeb.render("Login", self));
-            self.$element.find('#database').click(self.on_db_select);
+            self.$element.find('#database').change(self.on_db_select);
             self.$element.find("#login").click(self.on_login);
             $.mobile.initializePage();
         })
     },
     on_db_select: function(ev) {
+        ev.preventDefault();
         var db = this.$element.find("#database option:selected").val();
         jQuery("#db_text").html(db);
     },

=== modified file 'addons/web_mobile/static/src/js/form_mobile.js'
--- addons/web_mobile/static/src/js/form_mobile.js	2011-07-13 05:21:10 +0000
+++ addons/web_mobile/static/src/js/form_mobile.js	2011-07-14 06:48:33 +0000
@@ -31,6 +31,8 @@
                 $("#oe_header").find("h1").html(result.fields_view.arch.attrs.string);
                 self.$element.html(QWeb.render("FormView", {'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : result.fields_view.fields, 'values' : data }));
 
+                    self.$element.find('select').change(self.on_select_option);
+
                     self.$element.find('a').click(function(){
 
                         for (var k = 0; k < notebooks.children.length; k++) {
@@ -80,6 +82,7 @@
                                 }
                             }
                         }
+                        self.$element.find('select').change(self.on_select_option);
                     });
                 });
         });
@@ -99,6 +102,11 @@
         }
         return this.fields;
     },
+    on_select_option: function(ev){
+        ev.preventDefault();
+        var $this = ev.currentTarget;
+        $($this).prev().find(".ui-btn-text").html($($this).find("option:selected").text());
+    },
 });
 
 }
\ No newline at end of file

=== modified file 'addons/web_mobile/static/src/xml/web_mobile.xml'
--- addons/web_mobile/static/src/xml/web_mobile.xml	2011-07-13 05:25:26 +0000
+++ addons/web_mobile/static/src/xml/web_mobile.xml	2011-07-14 06:48:33 +0000
@@ -133,7 +133,8 @@
                                 </span>
                                 <span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
                             </span>
-                            <select>
+
+                            <select t-att-id="'selection_'+fields[field.attrs.name].string">
                                 <t t-foreach="fields[field.attrs.name].selection" t-as="opt">
                                     <option t-att-value="opt[0]"><t t-esc="opt[1]"/></option>
                                 </t>
@@ -146,11 +147,14 @@
                         <div data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-c">
                             <span class="ui-btn-inner ui-btn-corner-all">
                                 <span class="ui-btn-text">
-                                    <t t-esc="values[field.attrs.name][1]"/>
+                                    <t t-if="values[field.attrs.name][1]">
+                                        <t t-esc="values[field.attrs.name][1]"/>
+                                    </t>
+                                    <!-- <t t-esc="values[field.attrs.name][1]+values[field.attrs.name]"/> -->
                                 </span>
                                 <span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
                             </span>
-                            <select>
+                            <select t-att-id="'selection_'+fields[field.attrs.name].string">
                                 <t t-if="fields[field.attrs.name].selection">
                                     <t t-foreach="fields[field.attrs.name].selection" t-as="opt">
                                         <option t-att-value="opt[0]"><t t-esc="opt[1]"/></option>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to