[Prev][Next][Index][Thread]

Using Frames




I am using cl-http 60.17 on Mac CL 3.9. I am trying to define a frameset
with two frames such that when I click on an anchor in one frame the
results can appear in the other frame, which is initially blank. I tried a
bare bones test (code below). It does not work, in that clicking on the
anchor in the "display" frame puts the output in the "display" frame rather
than the "menu" frame. I clearly don't have the right conceptual model. How
do I make this work?

Also, is it possible for clicking on a single anchor to update two or more
frames in a frameset?

    Thanks,

        Mark Klein


;
; This defines the overall frame
;

(defmethod show-frame-layout ((url url:http-computed-url) stream)
  (http:with-successful-response (stream :html)
    (html:with-html-document (:stream stream)
      (html:with-document-preamble (:stream stream)
        (html:declare-title "Frame Layout Example" :stream stream))
      (ns2.0:with-document-frameset (:columns '((:constraint 7)
(:constraint 3)) :stream stream)
        (ns2.0:note-document-frame :name "display" :reference
#u"/c-recs/display.html" :stream stream)
        (ns2.0:note-document-frame :name "menu" :stream stream)))))

(http:export-url #u"/c-recs/show-frame-layout.html"
                 :computed
                 :response-function #'show-frame-layout)

;
; This presents the display frame, with a link to the menu frame
;

(defmethod test-display ((url url:http-computed-url) stream)
  (http:with-successful-response (stream :html)
    (html:with-html-document (:stream stream)
      (html:with-document-preamble (:stream stream)
        (ns2.0:declare-base-reference :reference url :target "display"
:stream stream))
      (html:note-anchor "click here" :reference #u"/c-recs/menu.html"
:stream stream))))

(http:export-url #u"/c-recs/display.html"
                 :computed
                 :response-function #'test-display)

;
; This presents the menu frame
;

(defmethod test-menu ((url url:http-computed-url) stream)
  (http:with-successful-response (stream :html)
    (html:with-html-document (:stream stream)
      (html:with-document-preamble (:stream stream)
        (ns2.0:declare-base-reference :reference url :target "menu" :stream
stream))
      (format stream "A menu item"))))

(http:export-url #u"/c-recs/menu.html"
                 :computed
                 :response-function #'test-menu)


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

US Mail:
-------
Mark Klein, PhD
Information Systems Department
The Applied Research Laboratory
P.O. Box 30
State College, PA 16804-0030 USA

Express Mail Services:
---------------------
Mark Klein, PhD
Information Systems Department
Applied Science Building
Atherton Street
State College, PA 16804-0030 USA

Voice:  +1 (814) 863-5381
Fax:    +1 (814) 863-1396 (best) or 865-7097
Email:  klein@quark.arl.psu.edu
WWW:    http://quark.arl.psu.edu/klein-vita.html




Follow-Ups: