Zend_Dojo-Form-Elements.xml 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 15851 -->
  4. <sect2 id="zend.dojo.form.elements">
  5. <title>Dijitに特有のフォーム要素</title>
  6. <para>
  7. ビュー・ヘルパーが提供される各々のフォームdijitには、
  8. 対応する<classname>Zend_Form</classname>要素があります。
  9. dijitパラメータを操作するための以下のメソッドがそれらすべてにあります:
  10. </para>
  11. <itemizedlist>
  12. <listitem><para>
  13. <code>setDijitParam($key, $value)</code>:
  14. dijitパラメータを一つセットします。
  15. dijitパラメータがすでに存在すれば、上書きされます。
  16. </para></listitem>
  17. <listitem><para>
  18. <code>setDijitParams(array $params)</code>:
  19. 一度にいくつかのdijitパラメータをセットします。
  20. 渡されたパラメータにマッチする既存のパラメータは上書きされます。
  21. </para></listitem>
  22. <listitem><para>
  23. <code>hasDijitParam($key)</code>:
  24. 与えられたdijitパラメータが定義されたか存在している場合はtrueを返します。
  25. それ以外はfalseを返します。
  26. </para></listitem>
  27. <listitem><para>
  28. <code>getDijitParam($key)</code>:
  29. 与えられたdijitパラメータを返します。
  30. 利用できない場合は null値を返します。
  31. </para></listitem>
  32. <listitem><para>
  33. <code>getDijitParams()</code>:
  34. dijitパラメータを全て返します。
  35. </para></listitem>
  36. <listitem><para>
  37. <code>removeDijitParam($key)</code>:
  38. 与えられたdijitパラメータを除去します。
  39. </para></listitem>
  40. <listitem><para>
  41. <code>clearDijitParams()</code>:
  42. 現行定義されたdijitパラメータを全て消去します。
  43. </para></listitem>
  44. </itemizedlist>
  45. <para>
  46. Dijitパラメータは、<code>dijitParams</code> public プロパティに保存されます。
  47. このように、あなたは単にこのプロパティを要素の上に置くことによって、
  48. 既存のフォーム要素をdijit使用可能にすることができます;
  49. あなたは、単にパラメータを操作するのを容易にするために、
  50. 上記のアクセッサを持っていません。
  51. </para>
  52. <para>
  53. その上、dijitに特有の要素は以下に該当するデコレーターの独特な一覧を実装します:
  54. </para>
  55. <programlisting language="php"><![CDATA[
  56. $element->addDecorator('DijitElement')
  57. ->addDecorator('Errors')
  58. ->addDecorator('HtmlTag', array('tag' => 'dd'))
  59. ->addDecorator('Label', array('tag' => 'dt'));
  60. ]]></programlisting>
  61. <para>
  62. 実質的に、Dijit要素が、標準的なViewHelperデコレーターの代わりに使われます。
  63. </para>
  64. <para>
  65. 最後に、ベースDijit要素により、
  66. 確実にDojoビュー・ヘルパー・パスがビューの上に置かれることになります。
  67. </para>
  68. <para>
  69. Dijit要素、DijitMultiの変化は<code>Multi</code> abstract フォーム要素の機能を提供します。
  70. そして、開発者が 'multiOptions' を指定できるようにします。
  71. - 一般的に select の option またはラジオ のoptionです。
  72. </para>
  73. <para>
  74. 以下のdijit要素は、標準的なZend Framework配布において出荷されます。
  75. </para>
  76. <sect3 id="zend.dojo.form.elements.button">
  77. <title>ボタン</title>
  78. <para>
  79. <link linkend="zend.form.standardElements.button">標準的なボタン要素</link>に
  80. 由来していないので、
  81. 同じ機能を実装して、ドロップインの代わりとして使うことができます。
  82. 以下の機能が公開されます:
  83. </para>
  84. <itemizedlist>
  85. <listitem><para>
  86. 名前が提供されないならば、
  87. <code>getLabel()</code>はボタン・ラベルとして要素名を利用します。
  88. さらに、翻訳メッセージにマッチした翻訳アダプターが利用できれば、
  89. それは名前を翻訳します。
  90. </para></listitem>
  91. <listitem><para>
  92. <code>isChecked()</code>は、
  93. 提出される値がラベルにマッチするかどうか決定します;
  94. もしマッチするなら、それはtrueを返します。
  95. これは、フォームが提出されたとき、どのボタンが使われたかについて決定することに役立ちます。
  96. </para></listitem>
  97. </itemizedlist>
  98. <para>
  99. さらに、デコレーターの<code>DijitElement</code>及び
  100. <code>DtDdWrapper</code>だけがボタン要素のために使われます。
  101. </para>
  102. <example id="zend.dojo.form.elements.button.example">
  103. <title>ボタンdijit要素の使用例</title>
  104. <programlisting language="php"><![CDATA[
  105. $form->addElement(
  106. 'Button',
  107. 'foo',
  108. array(
  109. 'label' => 'Button Label',
  110. )
  111. );
  112. ]]></programlisting>
  113. </example>
  114. </sect3>
  115. <sect3 id="zend.dojo.form.elements.checkBox">
  116. <title>チェックボックス</title>
  117. <para>
  118. <link linkend="zend.form.standardElements.checkbox">標準的なチェックボックス要素</link>
  119. に由来していないので、
  120. それは同じ機能を実装します。
  121. これは、以下のメソッドが公開されることを意味します
  122. </para>
  123. <itemizedlist>
  124. <listitem><para>
  125. <code>setCheckedValue($value)</code>:
  126. 要素がチェックされたときに使う値を設定します。
  127. </para></listitem>
  128. <listitem><para>
  129. <code>getCheckedValue()</code>:
  130. チェックされたときに要素で使う値を取得します。
  131. </para></listitem>
  132. <listitem><para>
  133. <code>setUncheckedValue($value)</code>:
  134. チェックされていないときに要素で使う値を設定します。
  135. </para></listitem>
  136. <listitem><para>
  137. <code>getUncheckedValue()</code>:
  138. チェックされていないときに要素で使う値を取得します。
  139. </para></listitem>
  140. <listitem><para>
  141. <code>setChecked($flag)</code>:
  142. 要素をチェック済みにするか否か設定します。
  143. </para></listitem>
  144. <listitem><para>
  145. <code>isChecked()</code>:
  146. 要素が現在チェック済みか判断します。
  147. </para></listitem>
  148. </itemizedlist>
  149. <example id="zend.dojo.form.elements.checkBox.example">
  150. <title>チェックボックスdijit要素の使用例</title>
  151. <programlisting language="php"><![CDATA[
  152. $form->addElement(
  153. 'CheckBox',
  154. 'foo',
  155. array(
  156. 'label' => 'A check box',
  157. 'checkedValue' => 'foo',
  158. 'uncheckedValue' => 'bar',
  159. 'checked' => true,
  160. )
  161. );
  162. ]]></programlisting>
  163. </example>
  164. </sect3>
  165. <sect3 id="zend.dojo.form.elements.comboBox">
  166. <title>コンボボックス及びフィルタリング選択</title>
  167. <para>
  168. コンボボックス
  169. <link linkend="zend.dojo.view.dijit.form">dijitビュー・ヘルパー・文書</link>
  170. にみられるように、コンボボックスは選択とテキスト入力の混合です。
  171. そして、自動補完及び、提示された選択肢の代わりを指定できるようにします。
  172. フィルタリング選択は同じことですが、任意の入力を許しません。
  173. </para>
  174. <note>
  175. <title>ラベル値を返すコンボボックス</title>
  176. <para>
  177. コンボボックスはラベル値を返します。
  178. 期待に反するオプション値は返しません。
  179. この理由から、コンボボックスは<code>InArray</code>バリデーターを自動登録しません。
  180. (FilteringSelectsがそうするけれども)
  181. </para>
  182. </note>
  183. <para>
  184. コンボボックスとフィルタリング選択フォーム要素は、
  185. dojo.dataデータ・ストア(使用された場合)を指定することだけでなく、
  186. 選ばれた選択肢を調べて、セットするためにアクセッサとミューテーターを提供します。
  187. それらはDijitMultiから拡張します。
  188. そして、それは<code>setMultiOptions()</code>と<code>setMultiOption()</code>メソッドによって
  189. 選ばれた選択肢を指定することができます。
  190. さらに、以下のメソッドを利用できます:
  191. </para>
  192. <itemizedlist>
  193. <listitem><para>
  194. <code>getStoreInfo()</code>:
  195. 現行で設定されているデータストア情報を全て取得します。
  196. 現行で設定されたデータがなければ、空の配列を返します。
  197. </para></listitem>
  198. <listitem><para>
  199. <code>setStoreId($identifier)</code>:
  200. ストアの識別変数を設定します。
  201. (通常、Dojoで 'jsId' 属性によって言及されます)
  202. これは、有効なjavascript変数の名前でなければなりません。
  203. </para></listitem>
  204. <listitem><para>
  205. <code>getStoreId()</code>:
  206. ストアの識別変数名を取得します。
  207. </para></listitem>
  208. <listitem><para>
  209. <code>setStoreType($dojoType)</code>:
  210. 使用するデータストアクラスを設定します;
  211. 例えば "dojo.data.ItemFileReadStore"
  212. </para></listitem>
  213. <listitem><para>
  214. <code>getStoreType()</code>:
  215. 使用するdojoデータストアクラスを取得します。
  216. </para></listitem>
  217. <listitem><para>
  218. <code>setStoreParams(array $params)</code>:
  219. データ・ストア・オブジェクトを構成するために使われるパラメータをいずれも設定します。
  220. 例えば、 dojo.data.ItemFileReadStore データストアでは
  221. dojo.dataオブジェクトを返す場所を指す 'url' パラメータを期待します。
  222. </para></listitem>
  223. <listitem><para>
  224. <code>getStoreParams()</code>:
  225. 現行で設定されているデータストアパラメータをいずれも取得します;
  226. もしなければ、空の配列を返します。
  227. </para></listitem>
  228. <listitem><para>
  229. <code>setAutocomplete($flag)</code>:
  230. ユーザーが要素から離れるとき、選ばれた項目が使われるかどうかを示します。
  231. </para></listitem>
  232. <listitem><para>
  233. <code>getAutocomplete()</code>:
  234. 自動補完フラグの値を取得します。
  235. </para></listitem>
  236. </itemizedlist>
  237. <para>
  238. dojo.dataストアが要素で登録されなければ、
  239. 登録された選択肢の配列のキーを検証する<code>InArray</code>バリデーターを
  240. この要素はデフォルトで登録します。
  241. <code>setRegisterInArrayValidator(false)</code>を呼び出すことでも、
  242. <code>registerInArrayValidator</code>設定キーにfalse値を渡すことでも、
  243. このふるまいを抑制することができます。
  244. </para>
  245. <example id="zend.dojo.form.elements.comboBox.selectExample">
  246. <title>コンボボックスdijit要素を選択肢入力として使う</title>
  247. <programlisting language="php"><![CDATA[
  248. $form->addElement(
  249. 'ComboBox',
  250. 'foo',
  251. array(
  252. 'label' => 'ComboBox (select)',
  253. 'value' => 'blue',
  254. 'autocomplete' => false,
  255. 'multiOptions' => array(
  256. 'red' => 'Rouge',
  257. 'blue' => 'Bleu',
  258. 'white' => 'Blanc',
  259. 'orange' => 'Orange',
  260. 'black' => 'Noir',
  261. 'green' => 'Vert',
  262. ),
  263. )
  264. );
  265. ]]></programlisting>
  266. </example>
  267. <example id="zend.dojo.form.elements.comboBox.datastoreExample">
  268. <title>コンボボックスdijit要素をデータ・ストアと一緒に使う</title>
  269. <programlisting language="php"><![CDATA[
  270. $form->addElement(
  271. 'ComboBox',
  272. 'foo',
  273. array(
  274. 'label' => 'ComboBox (datastore)',
  275. 'storeId' => 'stateStore',
  276. 'storeType' => 'dojo.data.ItemFileReadStore',
  277. 'storeParams' => array(
  278. 'url' => '/js/states.txt',
  279. ),
  280. 'dijitParams' => array(
  281. 'searchAttr' => 'name',
  282. ),
  283. )
  284. );
  285. ]]></programlisting>
  286. </example>
  287. <para>
  288. 前述の例は<code>ComboBox</code>の代わりに
  289. <code>FilteringSelect</code>を使用します。
  290. </para>
  291. </sect3>
  292. <sect3 id="zend.dojo.form.elements.currencyTextBox">
  293. <title>通貨テキストボックス</title>
  294. <para>
  295. 通過テキストボックスは、主に通貨入力をサポートするためにあります。
  296. 通貨はローカライズされるかもしれず、小数も非小数もサポートできます。
  297. </para>
  298. <para>
  299. <!-- TODO -->
  300. Internally, CurrencyTextBox derives from <link
  301. linkend="zend.dojo.form.elements.numberTextBox">NumberTextBox</link>,
  302. <link
  303. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>,
  304. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  305. all methods available to those classes are available. In addition,
  306. the following constraint methods can be used:
  307. </para>
  308. <itemizedlist>
  309. <listitem><para>
  310. <code>setCurrency($currency)</code>:
  311. 使用する通貨種類を設定します;
  312. <ulink url="http://en.wikipedia.org/wiki/ISO_4217">ISO-4217</ulink>
  313. 仕様に従うでしょう。
  314. </para></listitem>
  315. <listitem><para>
  316. <code>getCurrency()</code>:現行の通貨種類を取得します。
  317. </para></listitem>
  318. <listitem><para>
  319. <code>setSymbol($symbol)</code>: 3文字からなる<ulink
  320. url="http://en.wikipedia.org/wiki/ISO_4217">ISO-4217</ulink>
  321. 通貨記号を設定します。
  322. </para></listitem>
  323. <listitem><para>
  324. <code>getSymbol()</code>:
  325. 現行の通貨記号を取得します。
  326. </para></listitem>
  327. <listitem><para>
  328. <code>setFractional($flag)</code>:
  329. 通貨で小数を許すかどうか設定します。
  330. </para></listitem>
  331. <listitem><para>
  332. <code>getFractional()</code>:
  333. 小数フラグの状態を取得します。
  334. </para></listitem>
  335. </itemizedlist>
  336. <example id="zend.dojo.form.elements.currencyTextBox.example">
  337. <title>通貨テキストボックスdijit要素の使用例</title>
  338. <programlisting language="php"><![CDATA[
  339. $form->addElement(
  340. 'CurrencyTextBox',
  341. 'foo',
  342. array(
  343. 'label' => 'Currency:',
  344. 'required' => true,
  345. 'currency' => 'USD',
  346. 'invalidMessage' => 'Invalid amount. ' .
  347. 'Include dollar sign, commas, and cents.',
  348. 'fractional' => false,
  349. )
  350. );
  351. ]]></programlisting>
  352. </example>
  353. </sect3>
  354. <sect3 id="zend.dojo.form.elements.dateTextBox">
  355. <title>日付テキストボックス</title>
  356. <para>
  357. 日付テキストボックスは、
  358. カレンダー・ドロップダウンを日付(クライアント側日付確認とフォーマッティングだけでなく)
  359. を選ぶために提供します。
  360. </para>
  361. <para>
  362. <!-- TODO -->
  363. Internally, DateTextBox derives from <link
  364. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  365. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  366. all methods available to those classes are available. In addition,
  367. the following methods can be used to set individual constraints:
  368. </para>
  369. <itemizedlist>
  370. <listitem><para>
  371. <code>setAmPm($flag)</code> and <code>getAmPm()</code>:
  372. 時刻でAM/PM 文字列を使うかどうか
  373. </para></listitem>
  374. <listitem><para>
  375. <code>setStrict($flag)</code> and <code>getStrict()</code>:
  376. 入力を確認した時にマッチする厳しい正規表現を使うかどうか。
  377. デフォルトはfalseですが、空白文字やいくつかの省略形を許します。
  378. </para></listitem>
  379. <listitem><para>
  380. <code>setLocale($locale)</code> and <code>getLocale()</code>:
  381. 指定した要素で使うロケールを設定または取得します。
  382. </para></listitem>
  383. <listitem><para>
  384. <code>setDatePattern($pattern)</code>及び
  385. <code>getDatePattern()</code>:
  386. 日付をフォーマットする<ulink
  387. url="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">
  388. unicode 日付形式パターン</ulink>を提示または取得します。
  389. </para></listitem>
  390. <listitem><para>
  391. <code>setFormatLength($formatLength)</code>及び
  392. <code>getFormatLength()</code>:
  393. 使用する形式の長さの種類を提示または取得します;
  394. "long"、"short"、"medium"または"full"のどれか一つです。
  395. </para></listitem>
  396. <listitem><para>
  397. <code>setSelector($selector)</code>及び
  398. <code>getSelector()</code>:
  399. セレクタのスタイルを提示または取得します;
  400. "date" や "time" のどちらかでしょう。
  401. </para></listitem>
  402. </itemizedlist>
  403. <example id="zend.dojo.form.elements.dateTextBox.example">
  404. <title>日付テキストボックスdijit要素の使用例</title>
  405. <programlisting language="php"><![CDATA[
  406. $form->addElement(
  407. 'DateTextBox',
  408. 'foo',
  409. array(
  410. 'label' => 'Date:',
  411. 'required' => true,
  412. 'invalidMessage' => 'Invalid date specified.',
  413. 'formatLength' => 'long',
  414. )
  415. );
  416. ]]></programlisting>
  417. </example>
  418. </sect3>
  419. <sect3 id="zend.dojo.form.elements.editor">
  420. <title>エディタ</title>
  421. <para>
  422. Editor provides a WYSIWYG editor that can be used to both create and
  423. edit rich HTML content. dijit.Editor is pluggable and may be
  424. extended with custom plugins if desired; see <ulink
  425. url="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/advanced-editing-and-display/editor-rich-text">the
  426. dijit.Editor documentation</ulink> for more details.
  427. </para>
  428. <para>
  429. The Editor form element provides a number of accessors and mutators
  430. for manipulating various dijit parameters, as follows:
  431. </para>
  432. <itemizedlist>
  433. <listitem>
  434. <para>
  435. <emphasis>captureEvents</emphasis> are events that connect
  436. to the editing area itself. The following accessors and
  437. mutators are available for manipulating capture events:
  438. </para>
  439. <itemizedlist>
  440. <listitem><para><code>addCaptureEvent($event)</code></para></listitem>
  441. <listitem><para><code>addCaptureEvents(array $events)</code></para></listitem>
  442. <listitem><para><code>setCaptureEvents(array $events)</code></para></listitem>
  443. <listitem><para><code>getCaptureEvents()</code></para></listitem>
  444. <listitem><para><code>hasCaptureEvent($event)</code></para></listitem>
  445. <listitem><para><code>removeCaptureEvent($event)</code></para></listitem>
  446. <listitem><para><code>clearCaptureEvents()</code></para></listitem>
  447. </itemizedlist>
  448. </listitem>
  449. <listitem>
  450. <para>
  451. <emphasis>events</emphasis> are standard DOM events, such as
  452. onClick, onKeyUp, etc. The following accessors and mutators
  453. are available for manipulating events:
  454. </para>
  455. <itemizedlist>
  456. <listitem><para><code>addEvent($event)</code></para></listitem>
  457. <listitem><para><code>addEvents(array $events)</code></para></listitem>
  458. <listitem><para><code>setEvents(array $events)</code></para></listitem>
  459. <listitem><para><code>getEvents()</code></para></listitem>
  460. <listitem><para><code>hasEvent($event)</code></para></listitem>
  461. <listitem><para><code>removeEvent($event)</code></para></listitem>
  462. <listitem><para><code>clearEvents()</code></para></listitem>
  463. </itemizedlist>
  464. </listitem>
  465. <listitem>
  466. <para>
  467. <emphasis>plugins</emphasis> add functionality to the
  468. Editor -- additional tools for the toolbar, additional
  469. styles to allow, etc. The following accessors and mutators
  470. are available for manipulating plugins:
  471. </para>
  472. <itemizedlist>
  473. <listitem><para><code>addPlugin($plugin)</code></para></listitem>
  474. <listitem><para><code>addPlugins(array $plugins)</code></para></listitem>
  475. <listitem><para><code>setPlugins(array $plugins)</code></para></listitem>
  476. <listitem><para><code>getPlugins()</code></para></listitem>
  477. <listitem><para><code>hasPlugin($plugin)</code></para></listitem>
  478. <listitem><para><code>removePlugin($plugin)</code></para></listitem>
  479. <listitem><para><code>clearPlugins()</code></para></listitem>
  480. </itemizedlist>
  481. </listitem>
  482. <listitem>
  483. <para>
  484. <emphasis>editActionInterval</emphasis> is used to group
  485. events for undo operations. By default, this value is 3
  486. seconds. The method
  487. <code>setEditActionInterval($interval)</code> may be used to
  488. set the value, while <code>getEditActionInterval()</code>
  489. will retrieve it.
  490. </para>
  491. </listitem>
  492. <listitem>
  493. <para>
  494. <emphasis>focusOnLoad</emphasis> is used to determine
  495. whether this particular editor will receive focus when the
  496. page has loaded. By default, this is false. The method
  497. <code>setFocusOnLoad($flag)</code> may be used to
  498. set the value, while <code>getFocusOnLoad()</code>
  499. will retrieve it.
  500. </para>
  501. </listitem>
  502. <listitem>
  503. <para>
  504. <emphasis>height</emphasis> specifies the height of the
  505. editor; by default, this is 300px. The method
  506. <code>setHeight($height)</code> may be used to set the
  507. value, while <code>getHeight()</code> will retrieve it.
  508. </para>
  509. </listitem>
  510. <listitem>
  511. <para>
  512. <emphasis>inheritWidth</emphasis> is used to determine
  513. whether the editor will use the parent container's width or
  514. simply default to 100% width. By default, this is false
  515. (i.e., it will fill the width of the window). The method
  516. <code>setInheritWidth($flag)</code> may be used to set the
  517. value, while <code>getInheritWidth()</code> will retrieve
  518. it.
  519. </para>
  520. </listitem>
  521. <listitem>
  522. <para>
  523. <emphasis>minHeight</emphasis> indicates the minimum height
  524. of the editor; by default, this is 1em. The method
  525. <code>setMinHeight($height)</code> may be used to set the
  526. value, while <code>getMinHeight()</code> will retrieve it.
  527. </para>
  528. </listitem>
  529. <listitem>
  530. <para>
  531. <emphasis>styleSheets</emphasis> indicate what additional
  532. CSS stylesheets should be used to affect the display of the
  533. Editor. By default, none are registered, and it inherits the
  534. page styles. The following accessors and mutators are
  535. available for manipulating editor stylesheets:
  536. </para>
  537. <itemizedlist>
  538. <listitem><para><code>addStyleSheet($styleSheet)</code></para></listitem>
  539. <listitem>
  540. <para><code>addStyleSheets(array $styleSheets)</code></para>
  541. </listitem>
  542. <listitem>
  543. <para><code>setStyleSheets(array $styleSheets)</code></para>
  544. </listitem>
  545. <listitem><para><code>getStyleSheets()</code></para></listitem>
  546. <listitem><para><code>hasStyleSheet($styleSheet)</code></para></listitem>
  547. <listitem><para><code>removeStyleSheet($styleSheet)</code></para></listitem>
  548. <listitem><para><code>clearStyleSheets()</code></para></listitem>
  549. </itemizedlist>
  550. </listitem>
  551. </itemizedlist>
  552. <example id="zend.dojo.form.elements.editor.example">
  553. <title>エディタdijit要素の使用例</title>
  554. <programlisting language="php"><![CDATA[
  555. $form->addElement('editor', 'content', array(
  556. 'plugins' => array('undo', '|', 'bold', 'italic'),
  557. 'editActionInterval' => 2,
  558. 'focusOnLoad' => true,
  559. 'height' => '250px',
  560. 'inheritWidth' => true,
  561. 'styleSheets' => array('/js/custom/editor.css'),
  562. ));
  563. ]]></programlisting>
  564. </example>
  565. </sect3>
  566. <sect3 id="zend.dojo.form.elements.horizontalSlider">
  567. <title>HorizontalSlider</title>
  568. <para>
  569. HorizontalSlider provides a slider UI widget for selecting a
  570. numeric value in a range. Internally, it sets the value of a hidden
  571. element which is submitted by the form.
  572. </para>
  573. <para>
  574. HorizontalSlider derives from the <link
  575. linkend="zend.dojo.form.elements.slider">abstract Slider dijit
  576. element</link>. Additionally, it has a variety of methods for
  577. setting and configuring slider rules and rule labels.
  578. </para>
  579. <itemizedlist>
  580. <listitem>
  581. <para>
  582. <code>setTopDecorationDijit($dijit)</code> and
  583. <code>setBottomDecorationDijit($dijit)</code>: set the name
  584. of the dijit to use for either the top or bottom of the
  585. slider. This should not include the "dijit.form." prefix,
  586. but rather only the final name -- one of "HorizontalRule"
  587. or "HorizontalRuleLabels".
  588. </para>
  589. </listitem>
  590. <listitem>
  591. <para>
  592. <code>setTopDecorationContainer($container)</code> and
  593. <code>setBottomDecorationContainer($container)</code>:
  594. specify the name to use for the container element of the
  595. rules; e.g. 'topRule', 'topContainer', etc.
  596. </para>
  597. </listitem>
  598. <listitem>
  599. <para>
  600. <code>setTopDecorationLabels(array $labels)</code> and
  601. <code>setBottomDecorationLabels(array $labels)</code>: set
  602. the labels to use for one of the RuleLabels dijit types.
  603. These should be an indexed array; specify a single empty
  604. space to skip a given label position (such as the beginning
  605. or end).
  606. </para>
  607. </listitem>
  608. <listitem>
  609. <para>
  610. <code>setTopDecorationParams(array $params)</code> and
  611. <code>setBottomDecorationParams(array $params)</code>:
  612. dijit parameters to use when configuring the given Rule or
  613. RuleLabels dijit.
  614. </para>
  615. </listitem>
  616. <listitem>
  617. <para>
  618. <code>setTopDecorationAttribs(array $attribs)</code> and
  619. <code>setBottomDecorationAttribs(array $attribs)</code>:
  620. HTML attributes to specify for the given Rule or RuleLabels
  621. HTML element container.
  622. </para>
  623. </listitem>
  624. <listitem>
  625. <para>
  626. <code>getTopDecoration()</code> and
  627. <code>getBottomDecoration()</code>: retrieve all metadata
  628. for a given Rule or RuleLabels definition, as provided by
  629. the above mutators.
  630. </para>
  631. </listitem>
  632. </itemizedlist>
  633. <example id="zend.dojo.form.elements.horizontalSlider.example">
  634. <title>Example HorizontalSlider dijit element usage</title>
  635. <para>
  636. The following will create a horizontal slider selection with
  637. integer values ranging from -10 to 10. The top will have labels
  638. at the 20%, 40%, 60%, and 80% marks. The botton will have rules
  639. at 0, 50%, and 100%. Each time the value is changed, the hidden
  640. element storing the value will be updated.
  641. </para>
  642. <programlisting language="php"><![CDATA[
  643. $form->addElement(
  644. 'HorizontalSlider',
  645. 'horizontal',
  646. array(
  647. 'label' => 'HorizontalSlider',
  648. 'value' => 5,
  649. 'minimum' => -10,
  650. 'maximum' => 10,
  651. 'discreteValues' => 11,
  652. 'intermediateChanges' => true,
  653. 'showButtons' => true,
  654. 'topDecorationDijit' => 'HorizontalRuleLabels',
  655. 'topDecorationContainer' => 'topContainer',
  656. 'topDecorationLabels' => array(
  657. ' ',
  658. '20%',
  659. '40%',
  660. '60%',
  661. '80%',
  662. ' ',
  663. ),
  664. 'topDecorationParams' => array(
  665. 'container' => array(
  666. 'style' => 'height:1.2em; font-size=75%;color:gray;',
  667. ),
  668. 'list' => array(
  669. 'style' => 'height:1em; font-size=75%;color:gray;',
  670. ),
  671. ),
  672. 'bottomDecorationDijit' => 'HorizontalRule',
  673. 'bottomDecorationContainer' => 'bottomContainer',
  674. 'bottomDecorationLabels' => array(
  675. '0%',
  676. '50%',
  677. '100%',
  678. ),
  679. 'bottomDecorationParams' => array(
  680. 'list' => array(
  681. 'style' => 'height:1em; font-size=75%;color:gray;',
  682. ),
  683. ),
  684. )
  685. );
  686. ]]></programlisting>
  687. </example>
  688. </sect3>
  689. <sect3 id="zend.dojo.form.elements.numberSpinner">
  690. <title>NumberSpinner</title>
  691. <para>
  692. A number spinner is a text element for entering numeric values; it
  693. also includes elements for incrementing and decrementing the value
  694. by a set amount.
  695. </para>
  696. <para>
  697. The following methods are available:
  698. </para>
  699. <itemizedlist>
  700. <listitem><para>
  701. <code>setDefaultTimeout($timeout)</code> and
  702. <code>getDefaultTimeout()</code>: set and retrieve the default
  703. timeout, in milliseconds, between when the button is held
  704. pressed and the value is changed.
  705. </para></listitem>
  706. <listitem><para>
  707. <code>setTimeoutChangeRate($rate)</code> and
  708. <code>getTimeoutChangeRate()</code>: set and retrieve the
  709. rate, in milliseconds, at which changes will be made when a
  710. button is held pressed.
  711. </para></listitem>
  712. <listitem><para>
  713. <code>setLargeDelta($delta)</code> and
  714. <code>getLargeDelta()</code>: set and retrieve the amount by
  715. which the numeric value should change when a button is held
  716. pressed.
  717. </para></listitem>
  718. <listitem><para>
  719. <code>setSmallDelta($delta)</code> and
  720. <code>getSmallDelta()</code>: set and retrieve the delta by
  721. which the number should change when a button is pressed once.
  722. </para></listitem>
  723. <listitem><para>
  724. <code>setIntermediateChanges($flag)</code> and
  725. <code>getIntermediateChanges()</code>: set and retrieve the
  726. flag indicating whether or not each value change should be
  727. shown when a button is held pressed.
  728. </para></listitem>
  729. <listitem><para>
  730. <code>setRangeMessage($message)</code> and
  731. <code>getRangeMessage()</code>: set and retrieve the message
  732. indicating the range of values available.
  733. </para></listitem>
  734. <listitem><para>
  735. <code>setMin($value)</code> and <code>getMin()</code>: set and
  736. retrieve the minimum value possible.
  737. </para></listitem>
  738. <listitem><para>
  739. <code>setMax($value)</code> and <code>getMax()</code>: set and
  740. retrieve the maximum value possible.
  741. </para></listitem>
  742. </itemizedlist>
  743. <example id="zend.dojo.form.elements.numberSpinner.example">
  744. <title>NumberSpinner dijit要素の使用例</title>
  745. <programlisting language="php"><![CDATA[
  746. $form->addElement(
  747. 'NumberSpinner',
  748. 'foo',
  749. array(
  750. 'value' => '7',
  751. 'label' => 'NumberSpinner',
  752. 'smallDelta' => 5,
  753. 'largeDelta' => 25,
  754. 'defaultTimeout' => 500,
  755. 'timeoutChangeRate' => 100,
  756. 'min' => 9,
  757. 'max' => 1550,
  758. 'places' => 0,
  759. 'maxlength' => 20,
  760. )
  761. );
  762. ]]></programlisting>
  763. </example>
  764. </sect3>
  765. <sect3 id="zend.dojo.form.elements.numberTextBox">
  766. <title>NumberTextBox</title>
  767. <para>
  768. A number text box is a text element for entering numeric values;
  769. unlike NumberSpinner, numbers are entered manually. Validations and
  770. constraints can be provided to ensure the number stays in a
  771. particular range or format.
  772. </para>
  773. <para>
  774. Internally, NumberTextBox derives from <link
  775. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  776. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  777. all methods available to those classes are available. In addition,
  778. the following methods can be used to set individual constraints:
  779. </para>
  780. <itemizedlist>
  781. <listitem><para>
  782. <code>setLocale($locale)</code> and <code>getLocale()</code>:
  783. specify and retrieve a specific or alternate locale to use with
  784. this dijit.
  785. </para></listitem>
  786. <listitem><para>
  787. <code>setPattern($pattern)</code> and
  788. <code>getPattern()</code>: set and retrieve a <ulink
  789. url="http://www.unicode.org/reports/tr35/#Number_Format_Patterns">number
  790. pattern format</ulink> to use to format the number.
  791. </para></listitem>
  792. <listitem><para>
  793. <code>setType($type)</code> and <code>getType()</code>: set and
  794. retrieve the numeric format type to use (should be one of
  795. 'decimal', 'percent', or 'currency').
  796. </para></listitem>
  797. <listitem><para>
  798. <code>setPlaces($places)</code> and <code>getPlaces()</code>:
  799. set and retrieve the number of decimal places to support.
  800. </para></listitem>
  801. <listitem><para>
  802. <code>setStrict($flag)</code> and <code>getStrict()</code>: set
  803. and retrieve the value of the strict flag, which indicates how
  804. much leniency is allowed in relation to whitespace and
  805. non-numeric characters.
  806. </para></listitem>
  807. </itemizedlist>
  808. <example id="zend.dojo.form.elements.numberTextBox.example">
  809. <title>数値テキストボックスdijit要素の使用例</title>
  810. <programlisting language="php"><![CDATA[
  811. $form->addElement(
  812. 'NumberTextBox',
  813. 'elevation',
  814. array(
  815. 'label' => 'NumberTextBox',
  816. 'required' => true,
  817. 'invalidMessage' => 'Invalid elevation.',
  818. 'places' => 0,
  819. 'constraints' => array(
  820. 'min' => -20000,
  821. 'max' => 20000,
  822. ),
  823. )
  824. );
  825. ]]></programlisting>
  826. </example>
  827. </sect3>
  828. <sect3 id="zend.dojo.form.elements.passwordTextBox">
  829. <title>PasswordTextBox</title>
  830. <para>
  831. PasswordTextBox is simply a ValidationTextBox that is tied to a
  832. password input; its sole purpose is to allow for a dijit-themed text
  833. entry for passwords that also provides client-side validation.
  834. </para>
  835. <para>
  836. Internally, NumberTextBox derives from <link
  837. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  838. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  839. all methods available to those classes are available.
  840. </para>
  841. <example id="zend.dojo.form.elements.passwordTextBox.example">
  842. <title>パスワードテキストボックスの使用例</title>
  843. <programlisting language="php"><![CDATA[
  844. $form->addElement(
  845. 'PasswordTextBox',
  846. 'password',
  847. array(
  848. 'label' => 'Password',
  849. 'required' => true,
  850. 'trim' => true,
  851. 'lowercase' => true,
  852. 'regExp' => '^[a-z0-9]{6,}$',
  853. 'invalidMessage' => 'Invalid password; ' .
  854. 'must be at least 6 alphanumeric characters',
  855. )
  856. );
  857. ]]></programlisting>
  858. </example>
  859. </sect3>
  860. <sect3 id="zend.dojo.form.elements.radioButton">
  861. <title>RadioButton</title>
  862. <para>
  863. RadioButton wraps standard radio input elements to provide a
  864. consistent look and feel with other dojo dijits.
  865. </para>
  866. <para>
  867. RadioButton extends from DijitMulti, which
  868. allows you to specify select options via the
  869. <code>setMultiOptions()</code> and <code>setMultiOption()</code>
  870. methods.
  871. </para>
  872. <para>
  873. By default, this element registers an <code>InArray</code> validator
  874. which validates against the array keys of registered options. You
  875. can disable this behavior by either calling
  876. <code>setRegisterInArrayValidator(false)</code>, or by passing a
  877. false value to the <code>registerInArrayValidator</code>
  878. configuration key.
  879. </para>
  880. <example id="zend.dojo.form.elements.radioButton.example">
  881. <title>ラジオボタンdijit要素の使用例</title>
  882. <programlisting language="php"><![CDATA[
  883. $form->addElement(
  884. 'RadioButton',
  885. 'foo',
  886. array(
  887. 'label' => 'RadioButton',
  888. 'multiOptions' => array(
  889. 'foo' => 'Foo',
  890. 'bar' => 'Bar',
  891. 'baz' => 'Baz',
  892. ),
  893. 'value' => 'bar',
  894. )
  895. );
  896. ]]></programlisting>
  897. </example>
  898. </sect3>
  899. <sect3 id="zend.dojo.form.elements.simpletextarea">
  900. <title>シンプルテキストエリア</title>
  901. <para>
  902. SimpleTextarea acts primarily like a standard HTML textarea. However, it
  903. does not support either the rows or cols settings. Instead, the
  904. textarea width should be specified using standard CSS measurements.
  905. Unlike Textarea, it will not grow automatically
  906. </para>
  907. <example id="zend.dojo.form.elements.simpletextarea.example">
  908. <title>シンプルテキストエリアdijit要素の使用例</title>
  909. <programlisting language="php"><![CDATA[
  910. $form->addElement(
  911. 'SimpleTextarea',
  912. 'simpletextarea',
  913. array(
  914. 'label' => 'SimpleTextarea',
  915. 'required' => true,
  916. 'style' => 'width: 80em; height: 25em;',
  917. )
  918. );
  919. ]]></programlisting>
  920. </example>
  921. </sect3>
  922. <sect3 id="zend.dojo.form.elements.slider">
  923. <title>Slider abstract element</title>
  924. <para>
  925. Slider is an abstract element from which
  926. <link linkend="zend.dojo.form.elements.horizontalSlider">HorizontalSlider</link>
  927. and
  928. <link linkend="zend.dojo.form.elements.verticalSlider">VerticalSlider</link>
  929. both derive. It exposes a number of common methods for configuring
  930. your sliders, including:
  931. </para>
  932. <itemizedlist>
  933. <listitem><para>
  934. <code>setClickSelect($flag)</code> and
  935. <code>getClickSelect()</code>: set and retrieve the flag
  936. indicating whether or not clicking the slider changes the
  937. value.
  938. </para></listitem>
  939. <listitem><para>
  940. <code>setIntermediateChanges($flag)</code> and
  941. <code>getIntermediateChanges()</code>: set and retrieve the
  942. flag indicating whether or not the dijit will send a
  943. notification on each slider change event.
  944. </para></listitem>
  945. <listitem><para>
  946. <code>setShowButtons($flag)</code> and
  947. <code>getShowButtons()</code>: set and retrieve the flag
  948. indicating whether or not buttons on either end will be
  949. displayed; if so, the user can click on these to change the
  950. value of the slider.
  951. </para></listitem>
  952. <listitem><para>
  953. <code>setDiscreteValues($value)</code> and
  954. <code>getDiscreteValues()</code>: set and retrieve the number
  955. of discrete values represented by the slider.
  956. </para></listitem>
  957. <listitem><para>
  958. <code>setMaximum($value)</code> and <code>getMaximum()</code>:
  959. set the maximum value of the slider.
  960. </para></listitem>
  961. <listitem><para>
  962. <code>setMinimum($value)</code> and <code>getMinimum()</code>:
  963. set the minimum value of the slider.
  964. </para></listitem>
  965. <listitem><para>
  966. <code>setPageIncrement($value)</code> and
  967. <code>getPageIncrement()</code>: set the amount by which the
  968. slider will change on keyboard events.
  969. </para></listitem>
  970. </itemizedlist>
  971. <para>
  972. Example usage is provided with each concrete extending class.
  973. </para>
  974. </sect3>
  975. <sect3 id="zend.dojo.form.elements.submitButton">
  976. <title>SubmitButton</title>
  977. <para>
  978. While there is no Dijit named SubmitButton, we include one here to
  979. provide a button dijit capable of submitting a form without
  980. requiring any additional javascript bindings. It works exactly like
  981. the <link linkend="zend.dojo.form.elements.button">Button
  982. dijit</link>.
  983. </para>
  984. <example id="zend.dojo.form.elements.submitButton.example">
  985. <title>サブミットボタンdijit要素の使用例</title>
  986. <programlisting language="php"><![CDATA[
  987. $form->addElement(
  988. 'SubmitButton',
  989. 'foo',
  990. array(
  991. 'required' => false,
  992. 'ignore' => true,
  993. 'label' => 'Submit Button!',
  994. )
  995. );
  996. ]]></programlisting>
  997. </example>
  998. </sect3>
  999. <sect3 id="zend.dojo.form.elements.textBox">
  1000. <title>TextBox</title>
  1001. <para>
  1002. TextBox is included primarily to provide a text input with
  1003. consistent look-and-feel to the other dijits. However, it also
  1004. includes some minor filtering and validation capabilities,
  1005. represented in the following methods:
  1006. </para>
  1007. <itemizedlist>
  1008. <listitem><para>
  1009. <code>setLowercase($flag)</code> and
  1010. <code>getLowercase()</code>: set and retrieve the flag
  1011. indicating whether or not input should be cast to lowercase.
  1012. </para></listitem>
  1013. <listitem><para>
  1014. <code>setPropercase($flag)</code> and
  1015. <code>getPropercase()</code>: set and retrieve the flag
  1016. indicating whether or not the input should be cast to Proper
  1017. Case.
  1018. </para></listitem>
  1019. <listitem><para>
  1020. <code>setUppercase($flag)</code> and <code>getUppercase()</code>: set and retrieve
  1021. the flag indicating whether or not the input should be cast to UPPERCASE.
  1022. </para></listitem>
  1023. <listitem><para>
  1024. <code>setTrim($flag)</code> and <code>getTrim()</code>: set and
  1025. retrieve the flag indicating whether or not leading or trailing
  1026. whitespace should be stripped.
  1027. </para></listitem>
  1028. <listitem><para>
  1029. <code>setMaxLength($length)</code> and
  1030. <code>getMaxLength()</code>: set and retrieve the maximum
  1031. length of input.
  1032. </para></listitem>
  1033. </itemizedlist>
  1034. <example id="zend.dojo.form.elements.textBox.example">
  1035. <title>テキストボックスdijit要素の使用例</title>
  1036. <programlisting language="php"><![CDATA[
  1037. $form->addElement(
  1038. 'TextBox',
  1039. 'foo',
  1040. array(
  1041. 'value' => 'some text',
  1042. 'label' => 'TextBox',
  1043. 'trim' => true,
  1044. 'propercase' => true,
  1045. )
  1046. );
  1047. ]]></programlisting>
  1048. </example>
  1049. </sect3>
  1050. <sect3 id="zend.dojo.form.elements.textarea">
  1051. <title>Textarea</title>
  1052. <para>
  1053. Textarea acts primarily like a standard HTML textarea. However, it
  1054. does not support either the rows or cols settings. Instead, the
  1055. textarea width should be specified using standard CSS measurements;
  1056. rows should be omitted entirely. The textarea will then grow
  1057. vertically as text is added to it.
  1058. </para>
  1059. <example id="zend.dojo.form.elements.textarea.example">
  1060. <title>テキストエリアdijit要素の使用例</title>
  1061. <programlisting language="php"><![CDATA[
  1062. $form->addElement(
  1063. 'Textarea',
  1064. 'textarea',
  1065. array(
  1066. 'label' => 'Textarea',
  1067. 'required' => true,
  1068. 'style' => 'width: 200px;',
  1069. )
  1070. );
  1071. ]]></programlisting>
  1072. </example>
  1073. </sect3>
  1074. <sect3 id="zend.dojo.form.elements.timeTextBox">
  1075. <title>TimeTextBox</title>
  1076. <para>
  1077. TimeTextBox is a text input that provides a drop-down for selecting
  1078. a time. The drop-down may be configured to show a certain window of
  1079. time, with specified increments.
  1080. </para>
  1081. <para>
  1082. Internally, TimeTextBox derives from <link
  1083. linkend="zend.dojo.form.elements.dateTextBox">DateTextBox</link>,
  1084. <link
  1085. linkend="zend.dojo.form.elements.validationTextBox">ValidationTextBox</link>
  1086. and <link linkend="zend.dojo.form.elements.textBox">TextBox</link>;
  1087. all methods available to those classes are available. In addition,
  1088. the following methods can be used to set individual constraints:
  1089. </para>
  1090. <itemizedlist>
  1091. <listitem><para>
  1092. <code>setTimePattern($pattern)</code> and
  1093. <code>getTimePattern()</code>: set and retrieve the <ulink
  1094. url="http://www.unicode.org/reports/tr35/#Date_Format_Patterns">unicode
  1095. time format pattern</ulink> for formatting the time.
  1096. </para></listitem>
  1097. <listitem><para>
  1098. <code>setClickableIncrement($format)</code> and
  1099. <code>getClickableIncrement()</code>: set the <ulink
  1100. url="http://en.wikipedia.org/wiki/ISO_8601">ISO-8601</ulink>
  1101. string representing the amount by which every clickable element
  1102. in the time picker increases.
  1103. </para></listitem>
  1104. <listitem><para>
  1105. <code>setVisibleIncrement($format)</code> and
  1106. <code>getVisibleIncrement()</code>: set the increment visible
  1107. in the time chooser; must follow ISO-8601 formats.
  1108. </para></listitem>
  1109. <listitem><para>
  1110. <code>setVisibleRange($format)</code> and
  1111. <code>getVisibleRange()</code>: set and retrieve the range of
  1112. time visible in the time chooser at any given moment; must
  1113. follow ISO-8601 formats.
  1114. </para></listitem>
  1115. </itemizedlist>
  1116. <example id="zend.dojo.form.elements.timeTextBox.example">
  1117. <title>時刻テキストボックスdijit要素の使用例</title>
  1118. <para>
  1119. The following will create a TimeTextBox that displays 2 hours
  1120. at a time, with increments of 10 minutes.
  1121. </para>
  1122. <programlisting language="php"><![CDATA[
  1123. $form->addElement(
  1124. 'TimeTextBox',
  1125. 'foo',
  1126. array(
  1127. 'label' => 'TimeTextBox',
  1128. 'required' => true,
  1129. 'visibleRange' => 'T04:00:00',
  1130. 'visibleIncrement' => 'T00:10:00',
  1131. 'clickableIncrement' => 'T00:10:00',
  1132. )
  1133. );
  1134. ]]></programlisting>
  1135. </example>
  1136. </sect3>
  1137. <sect3 id="zend.dojo.form.elements.validationTextBox">
  1138. <title>ValidationTextBox</title>
  1139. <para>
  1140. ValidationTextBox provides the ability to add validations and constraints to a text
  1141. input. Internally, it derives from <link
  1142. linkend="zend.dojo.form.elements.textBox">TextBox</link>, and adds the following
  1143. accessors and mutators for manipulating dijit parameters:
  1144. </para>
  1145. <itemizedlist>
  1146. <listitem><para>
  1147. <code>setInvalidMessage($message)</code> and
  1148. <code>getInvalidMessage()</code>: set and retrieve the tooltip
  1149. message to display when the value does not validate.
  1150. </para></listitem>
  1151. <listitem><para>
  1152. <code>setPromptMessage($message)</code> and
  1153. <code>getPromptMessage()</code>: set and retrieve the tooltip
  1154. message to display for element usage.
  1155. </para></listitem>
  1156. <listitem><para>
  1157. <code>setRegExp($regexp)</code> and <code>getRegExp()</code>:
  1158. set and retrieve the regular expression to use for validating
  1159. the element. The regular expression does not need boundaries
  1160. (unlike PHP's preg* family of functions).
  1161. </para></listitem>
  1162. <listitem><para>
  1163. <code>setConstraint($key, $value)</code> and
  1164. <code>getConstraint($key)</code>: set and retrieve additional
  1165. constraints to use when validating the element; used primarily
  1166. with subclasses. Constraints are stored in the 'constraints'
  1167. key of the dijit parameters.
  1168. </para></listitem>
  1169. <listitem><para>
  1170. <code>setConstraints(array $constraints)</code> and
  1171. <code>getConstraints()</code>: set and retrieve individual
  1172. constraints to use when validating the element; used primarily
  1173. with subclasses.
  1174. </para></listitem>
  1175. <listitem><para>
  1176. <code>hasConstraint($key)</code>: test whether a given
  1177. constraint exists.
  1178. </para></listitem>
  1179. <listitem><para>
  1180. <code>removeConstraint($key)</code> and
  1181. <code>clearConstraints()</code>: remove an individual or all
  1182. constraints for the element.
  1183. </para></listitem>
  1184. </itemizedlist>
  1185. <example id="zend.dojo.form.elements.validationTextBox.example">
  1186. <title>ValidationTextBox dijit要素の使用例</title>
  1187. <para>
  1188. The following will create a ValidationTextBox that requires a
  1189. single string consisting solely of word characters (i.e., no
  1190. spaces, most punctuation is invalid).
  1191. </para>
  1192. <programlisting language="php"><![CDATA[
  1193. $form->addElement(
  1194. 'ValidationTextBox',
  1195. 'foo',
  1196. array(
  1197. 'label' => 'ValidationTextBox',
  1198. 'required' => true,
  1199. 'regExp' => '[\w]+',
  1200. 'invalidMessage' => 'Invalid non-space text.',
  1201. )
  1202. );
  1203. ]]></programlisting>
  1204. </example>
  1205. </sect3>
  1206. <sect3 id="zend.dojo.form.elements.verticalSlider">
  1207. <title>VerticalSlider</title>
  1208. <para>
  1209. VerticalSlider is the sibling of <link
  1210. linkend="zend.dojo.form.elements.horizontalSlider">HorizontalSlider</link>,
  1211. and operates in every way like that element. The only real
  1212. difference is that the 'top*' and 'bottom*' methods are replaced by
  1213. 'left*' and 'right*', and instead of using HorizontalRule and
  1214. HorizontalRuleLabels, VerticalRule and VerticalRuleLabels should be
  1215. used.
  1216. </para>
  1217. <example id="zend.dojo.form.elements.verticalSlider.example">
  1218. <title>VerticalSlider dijit要素の使用例</title>
  1219. <para>
  1220. The following will create a vertical slider selection with
  1221. integer values ranging from -10 to 10. The left will have labels
  1222. at the 20%, 40%, 60%, and 80% marks. The right will have rules
  1223. at 0, 50%, and 100%. Each time the value is changed, the hidden
  1224. element storing the value will be updated.
  1225. </para>
  1226. <programlisting language="php"><![CDATA[
  1227. $form->addElement(
  1228. 'VerticalSlider',
  1229. 'foo',
  1230. array(
  1231. 'label' => 'VerticalSlider',
  1232. 'value' => 5,
  1233. 'style' => 'height: 200px; width: 3em;',
  1234. 'minimum' => -10,
  1235. 'maximum' => 10,
  1236. 'discreteValues' => 11,
  1237. 'intermediateChanges' => true,
  1238. 'showButtons' => true,
  1239. 'leftDecorationDijit' => 'VerticalRuleLabels',
  1240. 'leftDecorationContainer' => 'leftContainer',
  1241. 'leftDecorationLabels' => array(
  1242. ' ',
  1243. '20%',
  1244. '40%',
  1245. '60%',
  1246. '80%',
  1247. ' ',
  1248. ),
  1249. 'rightDecorationDijit' => 'VerticalRule',
  1250. 'rightDecorationContainer' => 'rightContainer',
  1251. 'rightDecorationLabels' => array(
  1252. '0%',
  1253. '50%',
  1254. '100%',
  1255. ),
  1256. )
  1257. );
  1258. ]]></programlisting>
  1259. </example>
  1260. </sect3>
  1261. </sect2>
  1262. <!--
  1263. vim:se ts=4 sw=4 et:
  1264. -->