    :location (getinputvalue "upd_location")})
 
 (defn click-update[id]
-  (.assign js/location (str "#/documents/update/" id)))
+  (secretary/dispatch! (str "#/documents/update/" id)))
 
 (defn docupdate [event]
   (let [onres (fn[data]
-                (.assign js/location "/"))]
+                (secretary/dispatch! "/"))]
     (http-post "http://localhost:8193/documents/update"
                onres (.serialize (Serializer.) (clj->js (get-update-documents-formdata))))))
 

                (let [dt (getdata json)]
                  (set-key-value :documents dt)
                  (set-key-value :total-pages (get-total-rec-no dt))
                  (r/render [render-documents (get-new-page-data (get-value! :documents)
                                                                 (get-value! :current-page))]
                            (.getElementById js/document "app1"))
                  (r/render [shared-state 0]
                            (.getElementById js/document "pindex"))))]
    (http-get "http://localhost:8193/documents/all" onres)))

(defroute documents-path "/documents/add" []
  (r/render-component [document-template] (js/document.getElementById "add")))

(defroute documents-path1 "/documents/update/:id" [id]
  (r/render [document-update-template id
             (first (filter (fn[obj]
                              (=(.-id obj) (.parseInt js/window id))) (get-value! :documents)))]
            (js/document.getElementById "update")))

(defroute "*" []
  (js/alert "<h1>Not Found Page</h1>"))

(defn main
  []
  (secretary/set-config! :prefix "#")
  (let [history (History.)]
    (events/listen history "navigate"
                   (fn [event]

   [:div#dt (input "Date":Date :date)]
   [:div#loc (input "Location":text :location)]
   [:input {:type "button" :value "Save"
            :class "btn btn-primary" :on-click save}]
   [:input {:type "button" :value "Cancel"
            :class "btn btn-primary" :on-click cancel}]])

(defn get-update-documents-formdata []
  {
