search_form.xul can take and make URI query components
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Dec 2005 16:56:31 +0000 (16:56 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Dec 2005 16:56:31 +0000 (16:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2347 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_form.js
Open-ILS/xul/staff_client/server/patron/search_form.xul

index 4a8ae20..6a671ed 100644 (file)
@@ -66,6 +66,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.family_name) {
+                                                                       e.setAttribute('value',params.query.family_name);
                                                                        e.value = params.query.family_name;
                                                                } else {
                                                                        e.value = '';
@@ -78,6 +79,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.first_given_name) {
+                                                                       e.setAttribute('value',params.query.first_given_name);
                                                                        e.value = params.query.first_given_name;
                                                                } else {
                                                                        e.value = '';
@@ -90,7 +92,8 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.second_given_name) {
-                                                                       e.value = params.query.second_gtiven_name;
+                                                                       e.setAttribute('value',params.query.second_given_name);
+                                                                       e.value = params.query.second_given_name;
                                                                } else {
                                                                        e.value = '';
                                                                }
@@ -102,6 +105,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.email) {
+                                                                       e.setAttribute('value',params.query.email);
                                                                        e.value = params.query.email;
                                                                } else {
                                                                        e.value = '';
@@ -114,6 +118,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.phone) {
+                                                                       e.setAttribute('value',params.query.phone);
                                                                        e.value = params.query.phone;
                                                                } else {
                                                                        e.value = '';
@@ -126,6 +131,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.ident) {
+                                                                       e.setAttribute('value',params.query.ident);
                                                                        e.value = params.query.ident;
                                                                } else {
                                                                        e.value = '';
@@ -138,6 +144,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.street1) {
+                                                                       e.setAttribute('value',params.query.street1);
                                                                        e.value = params.query.street1;
                                                                } else {
                                                                        e.value = '';
@@ -150,6 +157,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.street2) {
+                                                                       e.setAttribute('value',params.query.street2);
                                                                        e.value = params.query.street2;
                                                                } else {
                                                                        e.value = '';
@@ -162,6 +170,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.city) {
+                                                                       e.setAttribute('value',params.query.city);
                                                                        e.value = params.query.city;
                                                                } else {
                                                                        e.value = '';
@@ -174,6 +183,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.state) {
+                                                                       e.setAttribute('value',params.query.state);
                                                                        e.value = params.query.state;
                                                                } else {
                                                                        e.value = '';
@@ -186,6 +196,7 @@ patron.search_form.prototype = {
                                                function(e) {
                                                        return function() {
                                                                if (params.query&&params.query.post_code) {
+                                                                       e.setAttribute('value',params.query.post_code);
                                                                        e.value = params.query.post_code;
                                                                } else {
                                                                        e.value = '';
@@ -197,6 +208,7 @@ patron.search_form.prototype = {
                        }
                );
 
+               obj.controller.render();
        },
 
        'on_submit' : function(q) {
index a758487..8cf6889 100644 (file)
@@ -42,8 +42,8 @@
                                var session = g.cgi.param('session');
                                var keys = g.cgi.keys();
                                var query = {};
-                               for (var i in keys) {
-                                       query[i] = g.cgi.param(i);
+                               for (var i = 0; i < keys.length; i++) {
+                                       query[keys[i]] = g.cgi.param(keys[i]);
                                }
 
                                JSAN.use('patron.search_form'); g.search_form = new patron.search_form();