XForms Tutorial> I-6.2.1. XForms input element

이 폼 컨트롤은 HTML의 INPUT 컨트롤과 유사한 유저인터페이스를 제공한다. 업무용 화면을 구성할 때 가장 많이 사용되는 컨트롤로서 이름, 주소 등의 일반적 데이터 뿐만 아니라 거의 모든 데이터를 취급할 수 있다. XForms에서의 input 컨트롤의 특징은 Binding 되는 Data Type 에 따라 동적으로 컨트롤이 바뀐다는 것이다. 예를 들어 Binding 되는 데이터 타입이 boolean 형이면 checkbox로, 날짜형이면 날짜 형식의 인터페이스를 제공하는 달력 으로 컨트롤이 변경되어야 한다. 이러한 특징은 HTML에서 지정되던 <input type="text"> 등과 같은 지정 방식을 사용하지 않고, 모델 데이터의 데이터 타입을 중심으로 하여 폼 컨트롤 인터페이스를 구성하였기 때문이다.

Common Attributes

  • Common, UI Common, Single Node Binding
Special Attributes
  • inputmode, incremental
Data Binding Restrictions
  • Binds to any simpleContent
  • SimpleContent 란? xsd:base64Binary, xsd:hexBinary 데이터 타입을 제외한 것을 말한다.
  • 거의 모든 Data Type을 Binding 할 수 있으나, 제약 타입이 있다. 대표적인 XML 스키마 데이터 타입으로서 xsd:base64Binary, xsd:hexBinary이 존재한다.
[Point] W3C Implementation Requirements
  • [Level-A] Ensure that setting of attribute incremental is respected as the user types in his message : incremental="true" 이면 값이 변경될 때마다 그 결과가 폼 컨트롤에 반영되어 정의된 다양한 Attribute들이 동작되어야 한다는 것을 의미한다. 예를 들어 값이 변경될 때 마다 Binding 되어 있는 Bind Element 또는 Instance node에 그 결과가 반영되어야 한다는 것을 말하며, 또한Bind Element에 정의되어 있는 다양한 Attribute 들이 동시에 수행되어야 한다는 것이다.
  • [Level-A] Ensure that user can type in valid data : Binding 되어 있는 Instance node의 데이터 타입에 맞게 데이터 정합성을 체크해야 한다는 의미이다. 예를 들어 Binding 되어 있는 Instance node의 데이터 타입이 xsd:integer 라면 정수형 데이터가 아닌 그 이외의 데이터인 경우 체크하여 사용자에게 어떤 방식으로든 메시지를 보여줄 수 있어야 한다는 것이다.
  • [Level-A] Render input bound to boolean type as checkbox if possible : Binding 되어 있는 Instance node의 데이터 타입이 xsd:boolean 일 경우 input형식의 컨트롤이 아니라 checkbox 컨트롤로 변환되어 유저에게 제공될 수 있어야 한다는 것이다.
…(생략)...
 <xforms:model>
  <xforms:instance>
   <root>
    <code>
     <id> 1951614 </id>
     <desc> 에스엠아이티 </desc>
    </code>
   </root>
  </xforms:instance>
 </xforms:model>
 

 </head>
 
 <body>
  <xforms:input ref="code/id"> 
   <xforms:label> 코드 </xforms:label>
  </xforms:input>
 </body>
</html>
  • ref attribute를 통해 인스턴스 code/id의 데이터를 Single-node Binding.
  • input element에 '1951614' 가 출력된다.

댓글 없음: