Dear ConTeXt users,
In experimenting with (JavaScript) fields I tried the example on p. 11
in the up-to-date 1998/1 publication.
I placed the check field not in the margin, but in the running text and
discovered
that \goto{Help}[JS(Toggle_Hide{Help})] does work if it is placed after
\fitfield[Help],
but that it does not work if it is placed before \fitfield[Help].
For the commands \goto{Hide Help}[HideField{Help}] and \goto{Show
Help}[ShowField{Help}]
their position relative to \fitfield[Help] does not matter.
Would it be possible to make a command ToggleField, analagous to HideField
and ShowField,
whose position relative to \fitfield[Help} is not important?
Thank you,
Sytse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here is the complete example:
\setupoutput[pdftex]
\setupinteraction[state=start]
\starttext
\definefield[Help][check][Helpsetup][helpinfo][helpinfo]
\setupfields[reset]
\setupfield[Helpsetup][width=fit,height=fit,frame=off,option={readonly,hidden}]
\definesymbol[helpinfo][\SomeHelpText]
\def\SomeHelpText%
{\framed
[width=\leftmarginwidth,height=fit,align=middle,style=small,
frame=on,background=color,backgroundcolor=white,framecolor=red]
{Click on the hide button to remove this screen}}
%\fitfield[Help] % if uncommented, all three \goto's work ok
Now we can put the button somewhere and turn the help on or off by saying
\goto{Hide Help}[HideField{Help}] or \goto{Show Help}[ShowField{Help}].
Although it's better to put these commands in a dedicated part of the screen.
And try \goto{Help}[JS(Toggle_Hide{Help})].
\fitfield[Help] % \goto{Help}[JS(Toggle_Hide{Help})] does not work
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%