voyent
Messages posted by: bbxfnet  XML
Profile for bbxfnet -> Messages posted by bbxfnet [5]
Author Message
See http://www.icefaces.org/JForum/posts/list/19551.page
See http://www.icefaces.org/JForum/posts/list/19551.page
See http://www.icefaces.org/JForum/posts/list/19551.page
See http://www.icefaces.org/JForum/posts/list/19551.page
Two problem with inputRichText using (Update or Won't display after session timeout)

Problem 1: (http://jira.icefaces.org/browse/ICE-7072)

Step:
1. Go the page contains inputRichText control.
2. Wait the session expired.
3. The page let me reload the page.
4. I reload the page, but the inputRichText can't display any more.



My solution as below:

Index: InputRichTextSetup.java
===================================================================
--- InputRichTextSetup.java (revision 25073)
+++ InputRichTextSetup.java (working copy)
@@ -68,7 +68,7 @@

private String getURI() {

- if (ckBaseURI == null) {
+ //if (ckBaseURI == null) {

ResourceRegistry registry =
ResourceRegistryLocator.locate(FacesContext.getCurrentInstance());
@@ -92,7 +92,7 @@
registry.loadJavascriptCode(ICE_CK_EDITOR_JS);

}
- }
+ //}
return ckBaseURI.toString();

}


Problem 2:

Step:
When value of back bean which inputRichText value binding changed, the inputRichText didn't display the latest data.

My solution as below:
Code:
                     <ice:inputRichText id="pageTree_referContent" 
                            height="400"
                            width="600"
                            toolbar="Default"
                            value="#{pageTreeView.referContent.content}"
                            language="en" customConfigPath="js/config.js"
                            skin="office2003" 
                            saveOnSubmit="true" 
                            />
 

Code:
 	public PageContent getReferContent() {
 		if (referContent.getContent() == null && selectedNode != null && selectedNode.getPageId() != null) {
 			referContent = new PageContent();
 			List<PageContent> contentArray = pageContentDao.findByIdType(Integer.valueOf(selectedNode.getPageId()), "refer");
 			if (contentArray != null && contentArray.size() > 0) {
 				referContent = contentArray.get(0);
 			}
 			String call = "CKEDITOR.instances['iceform:pageTree_referContent'].setData(document.getElementById('iceform:pageTree_referContent').value);";
 			JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), call);
 		}
 		return referContent;
 	}
 



Please see the "JavascriptContext.addJavascriptCall"e, I update the data of inputRichText by invoke javascript in back bean.
 
Profile for bbxfnet -> Messages posted by bbxfnet [5]
Go to:   
Powered by JForum 2.1.7ice © JForum Team