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
...
The form is given to the following topics :
BooksFromOreilly
BooksFromAddisonWesley
Now here is
BookForm :
BookForm is given to the following topics ( referenced by
BookList ) :
BeautifulCode
PerlHacks
PerlMedic
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
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.
%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
--
OlivierThompson - 26 Aug 2008