Tags:
create new tag
, view all tags
Context:

I set up a hidden field in order to force the default value for the UseCategory field to "Yes" when creating a new page. I couldīt find another way to set the UseCategory field to "Yes" as the default here was "No".

Problem:

If I set this default value to "Yes", both buttons are selected.

Solution:

I changed line 109 in twiki/bin/edit to

} elsif( ( $scatname eq "UseCategory" ) && ( $src eq "") &&
													 ^^^^^^^^^^^^^^^^ new

TWiki Version: Stable Dec 2000 -- DanielKabs - 23 Feb 2001

This is actually not a bug, and you don't need to make the change in the Perl source. You can save a default topic as you want it, then copy the content to the twiki/templates/Yourweb/notedited.tmpl template (including the category table). Compare also with twiki/templates/Know/notedited.tmpl that is included in the distribution.

-- PeterThoeny - 23 Feb 2001

Reading TWikiCategoryTable I couldīt find the hint you gave above, instead I found:

The default values of the category table can be specified as hidden fields

and following this suggestion (thus leaving notedited.tmpl empty), I added the following code to my page (please try and submit this form):

As you write in the documentation, using HiddenFields? one can set e.g. UseCategory to Yes or No.

The original code snippet looks like:

 if( $src =~ /$value[^a-zA-Z0-9\.]/ ) {
					 $flag = "checked";
				} elsif( ( $scatname eq "UseCategory" )  &&
							( ( $i == 3 && $ctext ) || ( $i == 4 && ! $ctext ) ) ) {
					 $flag = "checked";  

This means, depending on $ctext (which contains the html code for the category table, extracted from $text), either of the two buttons will be set. The problem is, the other could be set by $src through HiddenFields? .
Iīve done this in the example and thus you end up with both radiobuttons selected.

This is a bug!

Reference:

See also: CategoryRadioChecking

Cheers-- DanielKabs - 01 Mar 2001
Update -- DanielKabs - 11 Jun 2001

Same with me:

<form action="/twiki/edit/Myweb">
<input type="text" name="topic" value="JustATest" size="32">
<input type="hidden" name="UseCategory" value="Yes">
<input type="hidden" name="GroupIs" value="Test">
<input type="hidden" name="onlywikiname" value="on">
<input type="submit" value="Create topic">
</form>
yields both buttons selected. And at least with Netscape 4.7sth. I cannot disable the category - have to save and re-edit the topic override the default yes.

-- PeterKlausner 06 Jun 2001 - 16:13 - r1.4

No fix, the UseCategory radio buttons have been retired in favor of a form to select a template (or none). More at FormTemplateSystem.

-- PeterThoeny - 21 Aug 2001

TopicClassification:
BugRejected
Topic revision: r7 - 22 Aug 2001 - 05:41:07 - PeterThoeny
 
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