XForms Tutorial > I-6.2.9. The range Element

xforms:range Element
 
This form control allows selection from a sequential range of values.
Common Attributes : Common, UI Common, Single Node Binding
Special Attributes : start, end, step
  • start
  • Optional hint for the lexical starting bound for the range?a legal value for the underlying data. If provided, this value is used to further refine the constraints specified by the underlying model.
  • end
  • Optional hint for the ending bound for the range?a legal value for the underlying data. If provided, this value is used to further refine the constraints specified by the underlying model.
  • step
  • Optional value to use for incrementing or decrementing the value. Must be of a type capable of expressing the difference between two legal values of the underlying data.
Sample.
…(생략)...
<xforms:model id="mymodel">
 <xforms:instance id="request_01">
  <root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <node1></node1>
  </root>
 </xforms:instance>
 <xforms:instance id="response_01">
  <root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></root>
 </xforms:instance>
</xforms:model>


<body>
<xforms:range model="mymodel" ref="instance('request_01')/node1" end="10" start="1" step="1" style="position:absolute; top:73px; left:76px; width:216px; ">
 <xforms:label>range control</xforms:label>
</xforms:range> 
<xforms:input model="mymodel" ref="instance('request_01')/node1" maxlength="10" style="position:absolute; top:124px; left:77px; height:29px; width:215px; ">
 <xforms:label>range value :</xforms:label>
</xforms:input>
</body>
...(생략)...
  • range 컨트롤의 위치를 5로 위치하면 input control에 5가 출력된다.
  • 이는 range 컨트롤과 input 컨트롤이 참조하는 instnace node가 'request_01/node1 이기 때문이다.

댓글 없음: