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?

Category リストの追加

Category ドロップダウン・リストを追加し、CategoryName という名前の新しいクエリを割り当てます。このクエリを FilmCategory クラスに定義します。CategoryName のコードは以下のとおりであるとします。generated description: handson.gif

(各 <option> タグ内に記述された) リストの各要素には、オブジェクト ID を使用する値と、CategoryName プロパティを使用して表示するテキストを設定します。また、“*” 値と “Any Category” テキストを設定して、“any” オプションを追加します。Search.csp の HTML は、CategoryName クエリが定義されるまで正しく表示されないことに注意してください。

—Search.csp—
Search.csp
<html> <head></head>
<body>
<table width="100%" border="0"> <tr>
    <td><img src="CacheCinemaLogo.gif"></td>
    <td align="right">
    <form 
            name="Search" 
            action="SearchResults.csp" 
            target="Main" 
            method="post">
        <b>Find</b>
        <select name="CategoryList" size="1">
        <option value="*" selected>Any Category</option>
        <csp:query 
                name=CatList 
                classname="Cinema.FilmCategory" 
                queryname="CategoryName">
        <csp:while condition="CatList.Next()">
            <option value=#(CatList.Get("ID"))#>
            #(CatList.Get("CategoryName"))#</option>
        </csp:while>
        </select>
    </form>
    </td> </tr>
</table>
<hr>
</body> </html>
FeedbackOpens in a new tab