Feature Proposal: Nested searchs in nested forms for SearchPatternCookbook

Motivation

A similar question was answered in support web ( NestedSearch ) a few weeks ago ; this an explanation of nested searchs with nested forms for SearchPatternCookbook.

Description and Documentation

Insert from here

Pattern 11: Nested searchs in nested forms

Problem

We define the following form : PublisherForm

Name Type Size Values Tooltip message Attributes
Publisher text 40
BookList text 80
...

The form is given to the following topics :

BooksFromOreilly

Publisher OReilly

BooksFromAddisonWesley

Publisher Addison Wesley

Now here is BookForm :

Name Type Size Values Tooltip message Attributes
ISBN text 50

BookForm is given to the following topics ( referenced by BookList ) :

BeautifulCode

ISBN 978-0-596-51004-6

PerlHacks

ISBN 978-0-59-652674-0

PerlMedic

ISBN 978-0-201-79526-4

For each Publisher we would like to display a BookList of published books, and then each book's ISBN 's value.

Solution

Type this:

%SEARCH{ "^%META.*BookList.*value\=.*" topic="Books*" nosearch="on" multiple="on" nototal="on" web="%WEB%" type="regex" format=" * $topic $n$percntSEARCH{ search=\"^%META.*ISBN.*value\" topic=\"$formfield(BookList)\" type=\"regex\" multiple=\"on\" format=\" * $dollartopic : ISBN $dollarformfield(ISBN) \" nosearch=\"on\" nototal=\"on\" separator=\"$dollarn\" }$nop%" nosearch="on" separator="$n" nototal="on" }%

To get this :

to here

Impact

WhatDoesItAffect: Documentation

Implementation

-- Contributors: OlivierThompson - 25 Aug 2008

Discussion

Breaking up that long line makes it is easier to understand, which important to us cookbook readers.

It also makes it easier to see that you repeated a couple of terms. smile

%SEARCH{ 
 "^%META.*BookList.*value\=.*"
 topic="Books*" 
 nosearch="on" 
 multiple="on" 
 nototal="on" 
 web="%WEB%" 
 type="regex" 
 format=" * $topic $n$percntSEARCH{ search=\"^%META.*ISBN.*value\" topic=\"$formfield(BookList)\" type=\"regex\" multiple=\"on\" format=\" * $dollartopic : ISBN $dollarformfield(ISBN) \" nosearch=\"on\" nototal=\"on\" separator=\"$dollarn\" }$nop%" 
 nosearch="on" 
 separator="$n" 
 nototal="on" 
}%

-- SeanCMorgan - 26 Aug 2008

Oops ! You're right smile

-- OlivierThompson - 26 Aug 2008

Edit | Attach | (削除) Watch (削除ここまで) | Print version | History : r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008年08月26日 - OlivierThompson
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

AltStyle によって変換されたページ (->オリジナル) /