Tags:
create new tag
view all tags

SID-02031: Display form field of a referenced topic in formatted search

Status: Answered Answered TWiki version: 6.0.0 Perl version:
Category: CategorySearch Server OS: Ubuntu Linux 14.01 Last update: 10 years ago

It is probably simple but I did not find the solution after one day of searching docs and support pages and some trials and errors ...

I would like to maintain a list of conference paper contributions and see the deadline for abstract submission approaching. There may be more submissions to a single conference, so that the conference date can be stored in one Form called

ConferenceForm
containing the field "deadline_abstract"

| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| deadline_abstract | date | 60 | | deadline for abstract submission | |

and the object / form containing the paper data can refer to the conference using the select formfield called conference, i.e.:

ConferencePaperForm

| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| paper_title | text | 60 | | title of the paper | |
| conference | select+values | 1 | ---, %SEARCH{ "form.name='ConferenceForm'" type="query" excludetopic="*Template" nonoise="on" format="$topic" separator=", " }%  | conference topic in the coordination web | |

Now the question: how can I display a table of currently processed conference submissions listing the abstract deadline next to the paper title. I did not find a simple way to retrieve the formfield within the format specification of the variable.

| *Paper title* | *Conference* | *Abstract deadline* |
%SEARCH{ "form.name='ConferencePaperForm'" 
   type="query"
   sort="modified"
   excludetopic="*Template"
   nonoise="on"
   format="|$formfield(paper_title) | $formfield(conference)| How to access a field of conference here? |"}%

I also considered to defined a hidden field of ConferencePaperForm that would retrieve the value of the deadline from the ConferenceForm, but no success. I would be really happy for any hint. Many thanks.

-- Rostislav Chudoba - 2015-03-05

Discussion and Answer

Use the VarFORMFIELD variable to pull a form field value from another topic. When you use it in a FormattedSearch you need to delay the rendering so that it runs once per search hit, otherwise it will fire just once before the search. Delay by escaping the %-sign with $percnt. Untested example:

format="|$formfield(paper_title) | $formfield(conference) | $percntFORMFIELD{ \"deadline_abstract\" topic=\"$formfield(conference)\" }$percnt |"

Details in aforementioned links.

-- Peter Thoeny - 2015-03-05

If you are concerned about performance you could first do a search on conferences, store the deadline in a SpreadSheetPlugin hash, and use that hash in the paper title search. Example how to retrieve a hash called deadlines:

format="|$formfield(paper_title) | $formfield(conference) | $percntCALCULATE{$GETHASH(deadlines, $formfield(conference))}$percnt |"

Detail in blog Advanced TWiki Spreadsheet Formulas: Power and Flexibility - Not For Grandma.

-- Peter Thoeny - 2015-03-05

You saved my day, Peter.! The first version using VarFORMFIELD is actually clear and I was already trying this way. There are some examples elsewhere presenting the nested search which is similar. . I was not careful enough about the escaping within the format parameter.. Thank you for the other hints to the other possible solutions. I will need them.

-- Rostislav Chudoba - 2015-03-05

      Change status to:
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.
SupportForm
Status Answered
Title Display form field of a referenced topic in formatted search
SupportCategory CategorySearch
TWiki version 6.0.0
Server OS Ubuntu Linux 14.01
Web server apache 2
Perl version

Browser & version firefox
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2015-03-05 - RostislavChudoba
 
  • 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.