Tags:
create new tag
, view all tags

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
BookList BeautifulCode, PerlHacks

BooksFromAddisonWesley

Publisher Addison Wesley
BookList PerlMedic

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

 
Topic revision: r4 - 2008-08-26 - OlivierThompson
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.