Tags:
create new tag
view all tags

Question

Hi, I used "Formatted Search" to search filed value from the form, and encountered a problem. These are two links to show my problem: SearchFieldValueFromFormTest, SearchFieldValueFromForm

Here are the codes I wrote to search:

<div style="overflow:auto">
| *Program Name* | *Priority* | *Status* | *Summary* | *Description* |
%SEARCH{ "ShashaLuan" type="regex" nosearch="on" nosummary="on" nototal="on" web="Sandbox" topic="SearchFieldValueFromForm*" format="| $formfield(Program Name) | $formfield(Priority) | $formfield(Status) | $formfield(Summary) | $formfield(Description) |" }%
</div>
I got this:
Program Name Priority Status Summary Description
| Thingy | high | New | SearchFieldValueFromForm | 1. test
  1. change row
  2. see if it can display correctly
  3. why it can not change row
  4. change row works
  5. i need to use enter key |
CIM high New SearchValueFromFormCanNotDisplayCorrectly 1. test
2. change row
3. see if it can display correctly
4. why it can not change row SearchValueFromFormCanNotDisplayCorrectly
| CIM | high | New | Search Field Value From Form Test Two | 1. test 2. change row 3. see if it can display correctly 4. why it can not change row 5. change row works 6. i need to use enter key |

The first row can not be displayed normally because i wrote this in the "Description" field:

1. test 

2. change row

3. see if it can display correctly <br>

4. why it can not change row


The second row can be display correctly because i wrote:

1. test<br>2. change row<br>3. see if it can display correctly <br>4. why it can not change row

As there may be a lot of information write, i don't think tell user to write html code to change row is a right choice. Is there a way to solve that? smile

Environment

TWiki version: TWikiRelease04x00x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Redhat
Web server: Apache
Perl version:  
Client OS: WinXP
Web Browser: FireFox, IE
Categories: Forms, Search

-- ShashaLuan - 30 Jun 2006

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.

Thanks for taking the time for doing an excellent bug report. This is an example many could learn a lot from! smile

I think we have a problem in our documentation, as the parameter you need to give the SEARCH variable in this example, newline, doesn't seem to be documented in the current release.

I have updated SearchFieldValueFromForm to produce the correct result and submitted Bugs:Item2565 on the documentation issue.

Thanks for reporting!

-- SteffenPoulsen - 30 Jun 2006

Seems another puzzle in "search" method. If i wrote

1. test 
2. change row
3. see if it can display correctly
4. why it can not change row
5. change row works
6. i need to use enter key
in the form(because i'm haven't leave blank row in writing items), i can see the correct result in the search table, but why it can not be displayed correctly in "WebForm", see SearchFieldValueFromFormTestTwo. I'm confusing about that frown

-- ShashaLuan - 03 Jul 2006

When you output a table row with format="| something |, and the something has a newline, it will break the table apart since TWiki table rows need to start and end with "|". This can happen if you output a multi-line form field.

As a workaround you can generate an HTML table row instead of a TWiki table row. Example:

<table>
%SEARCH{ "..." ... format="<tr>$n<td> $formfield(foo) </td>$n<td> $formfield(bar) </td>$n</tr>" }%
</table>

-- PeterThoeny - 04 Jul 2006

Actually, there is a difference in the pre-TWiki4 and TWiki4 file format. Specifically the encoding of newlines in form fields (stored in meta data) changed. TWiki 4 encodes and stores newlines in formfields as %0d%0a. I am surprized that your SearchFieldValueFromFormTestTwo example works!

-- PeterThoeny - 04 Jul 2006

Thanks for you reply. smile But i still don't know how can i get correct display in the WebForm of the SearchFieldValueFromFormTestTwo ?

-- ShashaLuan - 04 Jul 2006

The display in the form is not different to ordinary display in a topic, and compressing the lines into one is how TWiki works per spec.

If you simply type this:

Line 1. Line 2.

It will be rendered as one line in the output. This is also how HTML works in general (compressing whitespace).

LikeEMail is discussing this behaviour, feel free to add your voice.

For numbered lists in general you should use the TML syntax for the purpose (both in topics and form fields :-)).

   1. Sushi
   1. Dim Sum
   1. Fondue

  1. Sushi
  2. Dim Sum
  3. Fondue

-- SteffenPoulsen - 04 Jul 2006

I asked such questions because i'm working on a project to implement Project Weekly Report Automation. I want to use twiki to do this. My original idea is each project report is Written in a *ProjectWeeklyReportForm*, and then i use "*Formatted Search Variable*" to consolidate each project in a unified table(Contents from each form fieldvalue). So i can see a single report in the form, and i can see a consolidated table with all projects in it. I will do a example and render details in WeeklyReport, welcome you comments and give me good advices thanks smile

-- ShashaLuan - 04 Jul 2006

Did you consider using RecursiveRenderPlugin for your reports. I used it once in a CommentPlugin template for generating a nice looking table where the users where allowed to specify all kind of TML in the collecting form.

-- FranzJosefSilli - 21 Jul 2006

Or the MultiEditPlugin with the noedit option?

-- ThomasWeigert - 25 Sep 2006

Thanks, i will have a try smile

-- ShashaLuan - 25 Sep 2006

Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2006-09-25 - ShashaLuan
 
  • 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.