2014-11-06 5 views
0

UI를 빌드 할 때 vaadin clara를 사용하고 있습니다.
1. 나는이 건축 사용하는 경우 :vaadin clara의 내부 html

<?xml version="1.0" encoding="UTF-8"?> 
<VerticalLayout xmlns="urn:import:com.vaadin.ui" xmlns:p="urn:vaadin:parent" defaultComponentAlignment="MIDDLE_CENTER"> 
     <Label caption=<![CDATA[<b>Register</b>]]> contentMode="HTML" width=""></Label> 
     <Form> 
      <TextField id="name" caption="Name"></TextField> 
      <TextField id="login" caption="E-mail"></TextField> 
      <PasswordField id="password" caption="Pass"></PasswordField> 
      <PasswordField id="password-check" caption="Pass check"></PasswordField> 
     </Form> 
     <HorizontalLayout> 
      <Button id="register-button" caption="Register"></Button> 
      <Button id="login-button" caption="Login"></Button> 
     </HorizontalLayout> 
</VerticalLayout> 

을 내가 가진 오류 :

HTTP Status 500 - com.vaadin.server.ServiceException: org.vaadin.teemu.clara.inflater.LayoutInflaterException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 18; Open quote is expected for attribute "{1}" associated with an element type "caption".


2.이 같은 구조를 사용하는 경우 :

... 
<Label caption="<b>Register</b>" contentMode="HTML" width=""></Label> 
... 

내가 가진 오류 :

HTTP Status 500 - com.vaadin.server.ServiceException: org.vaadin.teemu.clara.inflater.LayoutInflaterException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 19; The value of attribute "caption" associated with an element type "null" must not contain the '<' character.<br> 


3. 코드를 내부 HTML없이 사용하면 코드가 정상적으로 작동합니다.

... 
<Label caption="Register" contentMode="HTML" width=""></Label> 
... 

내 질문은 내부 HTML을 사용하는 방법입니다. 감사합니다. .

+0

사이드 노트 : CSS를 사용하는 것이 더 좋을 것 같습니다. – cfrick

답변

1

HTML을 인용/이스케이프해야합니다. 귀하의 경우에는 &lt;b&gt;Register&lt;/b&gt;입니다. XML이 유효해야합니다. 좋은 편집자 또는 IDE가이 사실에 대해 경고했거나 여러분을 위해 도망 칠 수있었습니다.