rich text 값을 rich tect 컨트롤의 replaceItemValue로 설정하는 방법은 무엇입니까? 서식있는 텍스트 컨트롤에서 replaceItemValue를 사용하여 문서 필드를 설정 하시겠습니까?
는 여기 코드의이 비트를 발견 http://www.bleedyellow.com/blogs/martin/entry/save_a_richtext_field_from_a_xpage_to_a_document?lang=en_usvar doc = configuratieformulieren.getDocumentByKey("ConfiguratieIVNL", true);
if(doc == null){
return;
}else{
var titel = getComponent("inputTextIBPTitelIVNL").getValue();
doc.replaceItemValue("IBPTitel",titel);
var inhoud = getComponent("inputRichTextIBPInhoudIVNL").getValue();
if (inhoud != null){
var contentType = doc.getMIMEEntity("IBPInhoud").getContentType();
var encoding = doc.getMIMEEntity("IBPInhoud").getEncoding();
var str = session.createStream();
inhoud.toString();
str.writeText(inhoud.toString());
doc.getMIMEEntity("IBPInhoud").setContentFromText(str, contentType, encoding);
}
doc.save(true, true);
}
sessionScope.put("FormulierIVNLInfoBeschPG","Lezen");
이 맞습니까? 이 코드는 필드가 이미 존재한다는 사실에 달려 있습니다. 필드가 존재하지 않는 경우 어떻게 처리합니까? 리치 텍스트 컨트롤의 내용에 필드 값을 설정하는 더 쉬운 방법이 있습니까?
프로그래밍 방식으로 항목의 값을 변경하려는 이유는 무엇입니까? 가장 쉬운 방법은 RT 컨트롤을 문서 소스의 richtext 항목에 바인딩하는 것입니다. –