We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
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 :

  • BooksFromOreilly?
    • BeautifulCode? : ISBN 978-0-596-51004-6
    • PerlHacks? : ISBN 978-0-59-652674-0
  • BooksFromAddisonWesley?
    • PerlMedic? : ISBN 978-0-201-79526-4

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 - 26 Aug 2008 - 19:26:28 - OlivierThompson
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback