Tags:
create new tag
, view all tags

Question

Hi all,

I'm not sure if what I'm trying to do is possible. I've tried to search the net some time and haven't found a solution, so here is what I'm trying to do.

Specifically, I have a table that represents the budget in my group. I've used EditTablePlugin to allow nice editing on the fly. The first field is Name, which represents the owner of the expense. I've tried to create an embedded SEARCH that retrieves all users and then use this as a select in the EditTable column. This appears to work until I hit EditTable button, then the resullting HTML is quite messed up and I see exposed implementation details etc.

Maybe I've done this completely wrong? Or is this a bug? I've copied the code below and simplified it a little

 
   * Set BALANCE = $EVAL(  ($VALUE($T(R$ROW(-1):C$COLUMN())) ) + ($VALUE($T(R$ROW():C$COLUMN(+2))) * 1.5 ) + ($VALUE($T(R$ROW():C$COLUMN(+3))) * 0.25 ) + ($VALUE($T(R$ROW():C$COLUMN(+4))) * 0.17 ) )
   * Set USERLIST = %SEARCH{"%META:FORM.*[U]serForm" web="Main" nosearch="on" type="regex" format=",$topic" }%

Name Item USD BALANCE In USD Euro ILS EGP
AaronCoday Trip 1 648.345 %USDSUM% 432.23    
AaronCoday Trip 2 706.93 %USDSUM%   234.34  
AaronCoday Trip 3 880.9165 %USDSUM%     1023.45
Total     432.23 234.34 1023.45

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Suse 10.3
Web server: Apache2
Perl version: default
Client OS: Windows XP SP2
Web Browser: Firefox
Categories: Search, Plugins

-- AaronCoday - 03 Jan 2008

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.

What do you get if you use the USERLIST variable by itself on the page somewhere?

-- MatthewCardozo - 04 Jan 2008

Hi,

When the above is rendered:

  • Set USERLIST = AaronCoday,
ChrisDahnken

Exactly. When I just use %USERLIST%

,AaronCoday ,ChrisDahnken

And a newline.

Aaron

-- AaronCoday - 09 Jan 2008

You need to suppress newlines in the SEARCH output: format="$topic" separator=", ". See details in VarSEARCH.

-- PeterThoeny - 09 Jan 2008

Thanks for the pointer, I had also been doing a couple of things wrong. In the end what I used for the EditTable line is:

%EDITTABLE{ format="| select, 1, %USERLIST% | text | label | label | text | text | text | " }%
I needed to use "%" instead of the escaped $percnt.

and

 * Set USERLIST = %SEARCH{"%META:FORM.*[U]serForm" web="Main" nosearch="on" nonoise="on" separator=", " type="regex" format="$topic" }%
Here adding the separator and nonoise made the difference.

Thanks

-- AaronCoday - 10 Jan 2008

Moving it to answered now.

-- AaronCoday - 10 Jan 2008

 
Change status to:
Topic revision: r5 - 2008-01-10 - AaronCoday
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.