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

Question

Is there a way to have the select field in an EditTable retrieve values from some table on another topic (as opposed to simply supplying the field with a list of values?).

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Solaris 10
Web server: Apache 2
Perl version: 5.8.4
Client OS: Windows XP SP2
Web Browser: firefox
Categories: Search

-- EyalTeutsch - 28 Nov 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Use an (parametrized) INCLUDE which contains a SEARCH.

-- FranzJosefGigler - 28 Nov 2007

Thanks - so now it's down to the regular expression details which for some reason I'm unable to produce. I was thinking that the the following should fetch all rows that start with a |M from EditTableSelectedValuesFromTopic1, and was hoping to get only the text inside the "=|=" (without any details on the topic found which I seem to be getting):

%SEARCH{"^\|M" scope="text" type="regex" web="Sandbox" topic="EditTableSelectedValuesFromTopic1" nosummary="on" nosearch="on" noheader="on" multiple="on" nototal="on" format=$pattern(^\|.*\|$)}%

-- EyalTeutsch- 29 Nov 2007

Ok - got it - was missing in the inner parentheses in the $pattern:

%SEARCH{"^\|M" scope="text" type="regex" web="Sandbox" topic="EditTableSelectedValuesFromTopic1" nosummary="on" nosearch="on" noheader="on" multiple="on" nototal="on" format="$pattern(^\|(.*?)\|.*)<br/>" }%

FranzJosefGigler
EyalTeutsch

-- EyalTeutsch - 03 Dec 2007

Did know you would get it. wink

-- FranzJosefGigler - 03 Dec 2007

I tried to setup EDITTABLE with a select field as described above - but failed miserably. Could someone please spell it out for me? Do I have to escape all the quotes and percent signs?

-- MartinKaufmann - 06 Dec 2007

I actually settled at the end to use predefined values. Not sure too, as to how one would take the above search pattern and implement it in a select field.

-- EyalTeutsch - 06 Dec 2007

%STARTSECTION{"mysearch"}%%SEARCH{"^\|M" scope="text" type="regex" web="Sandbox" topic="EditTableSelectedValuesFromTopic1" nosummary="on" nosearch="on" noheader="on" multiple="on" nototal="on" format="$pattern(^\|(.*?)\|.*)" separator="," }%%ENDSECTION{"mysearch"}%

Nr Selection Comment
1 FranzJosefGigler now I understand row smile you too?

-- FranzJosefGigler - 06 Dec 2007

Thanks for your help! I got it working now. Just one more question: Is it necessary to use the %INCLUDE% trick or does it work without as well?

-- MartinKaufmann - 07 Dec 2007

Should work without it as well, the include trick makes it just more ledgible.

-- FranzJosefGigler - 07 Dec 2007

thx Josef, now I see the light -:)

-- EyalTeutsch - 10 Dec 2007

 
Change status to:
Topic revision: r16 - 25 Feb 2008 - 16:46:04 - MichelleAlbertin
 
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