1*b1cdbd2cSJim Jagielski<?xml version="1.0" encoding="UTF-8"?> 2*b1cdbd2cSJim Jagielski 3*b1cdbd2cSJim Jagielski 4*b1cdbd2cSJim Jagielski 5*b1cdbd2cSJim Jagielski<!--*********************************************************** 6*b1cdbd2cSJim Jagielski * 7*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 8*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 9*b1cdbd2cSJim Jagielski * distributed with this work for additional information 10*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 11*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 12*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 13*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 14*b1cdbd2cSJim Jagielski * 15*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 16*b1cdbd2cSJim Jagielski * 17*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 18*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 19*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 21*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 22*b1cdbd2cSJim Jagielski * under the License. 23*b1cdbd2cSJim Jagielski * 24*b1cdbd2cSJim Jagielski ***********************************************************--> 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski 28*b1cdbd2cSJim Jagielski 29*b1cdbd2cSJim Jagielski <helpdocument version="1.0"> 30*b1cdbd2cSJim Jagielski<meta> 31*b1cdbd2cSJim Jagielski<topic id="textshared0201170700xml" indexer="include" status="PUBLISH"> 32*b1cdbd2cSJim Jagielski<title id="tit" xml-lang="en-US">HTML Filters and Forms</title> 33*b1cdbd2cSJim Jagielski<filename>/text/shared/02/01170700.xhp</filename> 34*b1cdbd2cSJim Jagielski</topic> 35*b1cdbd2cSJim Jagielski</meta> 36*b1cdbd2cSJim Jagielski<body> 37*b1cdbd2cSJim Jagielski<bookmark xml-lang="en-US" branch="index" id="bm_id3163829"><bookmark_value>forms; HTML filters</bookmark_value> 38*b1cdbd2cSJim Jagielski</bookmark> 39*b1cdbd2cSJim Jagielski<paragraph role="heading" id="hd_id3163829" xml-lang="en-US" level="1" l10n="U" oldref="1">HTML Filters and Forms</paragraph> 40*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3147285" xml-lang="en-US" l10n="U" oldref="2">You can use all control elements and form events in HTML documents. There have been numerous events to date (for example, focus events), which have not been changed. They will continue to be imported and exported as ONFOCUS, ONBLUR, and so on for JavaScript and as SDONFOCUS, SDONBLUR, and so on for $[officename] Basic.</paragraph> 41*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3150616" xml-lang="en-US" l10n="U" oldref="3">Generic names that consist of the Listener interface and the method name of the event are used for all other events: An event registered as XListener::method is exported as</paragraph> 42*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3147571" xml-lang="en-US" l10n="U" oldref="4">SDEvent-XListener-method = "/* event-code */"</paragraph> 43*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3152425" xml-lang="en-US" l10n="U" oldref="5">Note that the XListener- and method components of this option are case sensitive.</paragraph> 44*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3153683" xml-lang="en-US" l10n="U" oldref="6">Event handling of controls is performed using the $[officename] API. If you assign an event to a control, an object registers itself internally as a "Listener" for a specific control event. To do this, the object must use a specific interface, for example the XFocusListener Interface, so that it can react to focus events. When the event occurs, the control then invokes a special method of the Listener interface when the control receives the focus. The internally registered object then invokes the JavaScript or $[officename] Basic code, which was assigned to the event.</paragraph> 45*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3156410" xml-lang="en-US" l10n="U" oldref="7">The HTML filter now uses precisely these listener interfaces and method names so that it can import and export events as desired. You can register a focus event through</paragraph> 46*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3150506" xml-lang="en-US" l10n="U" oldref="8"><INPUT TYPE=text ONFOCUS="/* code */"</paragraph> 47*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3154289" xml-lang="en-US" l10n="U" oldref="9">rather than through the</paragraph> 48*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3155391" xml-lang="en-US" l10n="U" oldref="10"><INPUT TYPE=text SDEvent-XFocusListener-focusGained="/* code */"</paragraph> 49*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3152996" xml-lang="en-US" l10n="U" oldref="11">register. Events can therefore be registered as desired, including those not offered in the list boxes. To define the script language of events, you can write the following line in the document header:</paragraph> 50*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3150443" xml-lang="en-US" l10n="U" oldref="12"><META HTTP-EQUIV="content-script-type" CONTENT="..."></paragraph> 51*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3166410" xml-lang="en-US" l10n="U" oldref="13">As CONTENT you can, for example, use "text/x-StarBasic" for $[officename] Basic or a "text/JavaScript" for JavaScript. If no entry is made, JavaScript is assumed.</paragraph> 52*b1cdbd2cSJim Jagielski<paragraph role="paragraph" id="par_id3146797" xml-lang="en-US" l10n="U" oldref="14">During exporting, the default script language will be defined based on the first module found in macro management. For events, only one language can be used per document.</paragraph> 53*b1cdbd2cSJim Jagielski</body> 54*b1cdbd2cSJim Jagielski</helpdocument> 55