Tags:
create new tag
view all tags

Question

The form I try to construct has a layout that depends on search results. The search looks into a specific topic which has nothing but a table, and creates a text entry widget for each row.

In TopicToSearch:

| row1 |
| row2 |
| row3 |

The form then has:

| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| Name | text | 30 | | | M |
%SEARCH{ "^ *\| *.*? *\|" topic="TopicToSearch" web="Main" type="regex" scope="text" multiple="on" nonoise="on" format="| $pattern(^ *\| *(.*?) *\|.*) | text | 1 | 0 | | |" }%

If I look at the topic that defines the form, the search results are substituted and merged into the form properly, as it seems. But if I go to a topic that includes the form I don't see the widgets added by the search.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian 4.0
Web server: Apache 1.3
Perl version: 5.8.8
Client OS: Windows XPSP2
Web Browser: Firfox 3.0
Categories: Forms, Search

-- WilhelmTell - 30 Jun 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

yup. Thats a feature I once had in mind for Cairo too, but its not made it thus far. Basically, The TWikiForm definition does not evaluate TML statements before parsing the definition table.

its actually related to TWikiFormInheritance, though there is more to it if you're trying to dynamically set the fields based on a SEARCH.

-- SvenDowideit - 01 Jul 2008

So you're saying that it isn't possible to create forms dynamically, based on search results?

-- WilhelmTell - 02 Jul 2008

I have also found (what seems like) a bug when dynamically setting values of selection widgets for a form. I had a search similar to the one above (with a more appropriate format field though). The search worked when I displayed the table the defined the form, but not when displaying the form at the topics that include the form. Specifically, the values were surrounded by pipes, even though the format field used $pattern() to ignore the table's pipes. I worked it out by double-escaping the pipes (\\| as opposed to \|). The form then displayed the values correctly with the pipes stripped out, but the table defining the form then didn't list any of the values (a compromise I had to accept..).

-- WilhelmTell - 02 Jul 2008


Here is a solution :
  1. In the "TopicToSearch" topic : use a formated search with his results formated as a one column table beginning with |*Name*|
  2. Insert a line in your TWikiForms for the topic you call "TopicToSearch" ;
  3. Leave the corresponding field called "values" blank in the TWikiForms ..

Name Type Size Values Tooltip message Attributes
TopictoSearch select 1   blah blah...  

  • Please confirm this did help ..

-- OlivierThompson - 05 Jul 2008

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008-07-05 - OlivierThompson
 
  • Learn about TWiki  
  • Download TWiki
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.