Question
I am having a problem when using a custom comment template topic with Spreadsheet plug-in logic. And I'm not sure how to proceed.
A new topic is generated with a custom comment. The custom comment should add text to the bottom of the page based on the information specified in the comment.
However if the comment contains a comma, the spreadsheet IF logic contained in the comment template no longer works, because the CALC{IF(URLPARAM()...)} is embedded in the page HTML, and not evaluated immediately.
How do I force the CALC{IF()} logic to be expanded at the same time the URLPARAM is expanded to prevent this problem.
I have tried URLPARAM encode="entity" and encode="url", but these do not code a comma.
Comment Teplate Topic
%TMPL:DEF{PROMPT:issueupdatenew}%
<input %DISABLED% type="hidden" name="date" value="%DATE%"/>
%TABLE{ headeralign="right" dataalign="left" }%
| *Issue Status:* | <select name="CSStatus" ><option %SEARCH{ "CSStatus.*?value=\"SupportIssueReported\"" topic="%TOPIC%" scope="text" regex="on" nonoise="on" format="SELECTED" }% >SupportIssueReported</option> <option %SEARCH{ "CSStatus.*?value=\"SupportIssueAssigned\"" topic="%TOPIC%" scope="text" regex="on" nonoise="on" format="SELECTED" }% >SupportIssueAssigned</option> <option %SEARCH{ "CSStatus.*?value=\"SupportIssueResolved\"" topic="%TOPIC%" scope="text" regex="on" nonoise="on" format="SELECTED" }%>SupportIssueResolved</option></select> | __Note:__ Change status if needed|
| *Explanation:* | <textarea %DISABLED% name="answer" wrap="virtual" rows="6" cols="80" ></textarea> | __Note:__ Add comment or explain solution |
| <input %DISABLED% class="twikiSubmit" type="submit" value="Update"/> |
%TMPL:END%
%TMPL:DEF{OUTPUT:issueupdatenew}%
%POS:BOTTOM%
* *Issue Status Change:* _<NOP>%URLPARAM{"CSStatus"}%_ -- %WIKINAME% - %DATE%: %CALC{"$IF($LENGTH(%URLPARAM{"answer"}%,<UL><LI>%URLPARAM{"answer"}%</LI></UL>,)"}%
%TMPL:END%
Generated Comment Text
- Assignment Updated -- JeffreyLozier - 02 Apr 2008
- Issue Status Change: SupportIssueAssigned -- JeffreyLozier - 02 Apr 2008:
- Assignment Updated -- JeffreyLozier - 02 Apr 2008
- Issue Status Change: SupportIssueResolved -- JeffreyLozier - 02 Apr 2008:
- Assignment Updated -- JeffreyLozier - 02 Apr 2008
- Issue Status Change: SupportIssueAssigned -- JeffreyLozier - 02 Apr 2008:
- Issue Status Change: SupportIssueAssigned -- JeffreyLozier - 03 Apr 2008:
- Issue Status Change: SupportIssueAssigned -- JeffreyLozier - 03 Apr 2008:
Environment
-- JeffLozier - 03 Apr 2008
Answer
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.
And what does the %DISABLED% syntax with the form input type actually do. I have found no good explanation of this, and adding or removing seems to make no difference.
-- JeffLozier - 03 Apr 2008
I think the root problem here is that there is no way to escape a comma within SpreadSheetPlugin. I have recently run into a couple other situations recently where this was a problem. Sorry I don't have an answer to your immediate problem but just thought it worth noting that your particular case really illustrates a more general need.
-- LynnwoodBrown - 03 Apr 2008
Tricks around the comma problem:
- Nested functions:
$TRANSLATE() the comma into another character, do the manipulation, $TRANSLATE() it back
- Do the action in the "else" part of an IF, the "else" part can have as many commas you like (do a
$IF($NOT(...), , list stuff here)
-- PeterThoeny - 03 Apr 2008