Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

ShowTimes ページの HTML

次に、ShowTimes ページを作成します。スタジオを使用してこれを行います。ファイルに ShowTimes.csp という名前を付け、csp/user に保存します。

以下の HTML をページに追加します。その大部分は既に学習したことです。データを検索するには <csp:query> タグ、その結果をループするには <csp:while> タグを使用します。また、ページにデータを追加する場合は、次のようにします。

#(Times.Get("StartTime"))#

このように Caché データ参照を使用します。

この新しい要素は、<csp:query> にある “P1” 属性です。どの映画に興味があるかを識別するために、クエリで P1 を使用しました。

—ShowTimes.csp—
ShowTimes.csp
<html> <body>
<csp:query name="Times" classname="Cinema.Show"
    queryname="ShowTimes" P1='#(%request.Data("FilmID",1))#'>

<table cellpadding=5>
<tr>
    <td><b>Time</b></td>
    <td><b>Theater</b></td>
    </tr>

<csp:while condition="Times.Next()">
    <tr>
        <td>#(Times.Get("StartTime"))#</td>
        <td>#(Times.Get("TheaterName"))#</td>
    </tr>
</csp:while>
</table>
</body> </html>
FeedbackOpens in a new tab