Messages posted by Malakim
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Messages posted by: Malakim  XML
Profile for Malakim -> Messages posted by Malakim [20] Go to Page: 1, 2 Next 
Author Message
I just call it somewhere on the page, from a <script>-tag:

Code:
 <script type="text/javascript">
     sessionExtender();
 </script>
 


I'm sure you could call it from an on load script as well if you want to.
Sure, this is the Java code that lives in a servlet:

Code:
 protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     HttpSession session = request.getSession();
     if (session != null) {
         SessionDispatcher.Monitor.lookupSessionMonitor(session).touchSession();
     }
 }
 


And here's some JavaScript that performs the calls to the servlet:

Code:
 
 var session_t;
 function ajaxRequest(){
     var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; //activeX versions to check for in IE
     if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
         for (var i=0; i<activexmodes.length; i++){
             try{
                 return new ActiveXObject(activexmodes[i]);
             }
             catch(e){
             //suppress error
             }
         }
     }
     else if (window.XMLHttpRequest) // if Mozilla, Safari etc
         return new XMLHttpRequest();
     else
         return false;
 }
 
 function sessionExtender() {
     clearTimeout(session_t);
     var mygetrequest=new ajaxRequest();
     mygetrequest.onreadystatechange=function(){   }
     mygetrequest.open("GET", "/YOUR_PATH_HERE/TouchSession", true);
     mygetrequest.send(null);
     session_t=setTimeout("sessionExtender()", 1200000);
 }
 


IIRC the code was pretty much copied from the Jira page, and I do not know if this trick will work with IceFaces 2.

Good luck!
I've also tried forcing a save of the editor when submiting the form (via onclick on the submit button) - no luck.

I tried these variants:
Code:
function ieAutoSave() {
       Ice.FCKeditorUtility.saveAll();
 }
 

and
Code:
 function ieAutoSave() {
     var oEditor = FCKeditorAPI.GetInstance('createInvitationLetterForm:messageBody') ;
     var commands = oEditor.Commands;
     if(commands != null) {
         commands.GetCommand('Save').Execute();
     } else {
         Alert("Commands is null!");
     }
     return false;
 }
 

In both cases it fails due to not finding the editor object. That not even IceFaces own code seems to be able to find it seems fishy, no?
Hi,

I'm having problems with an ice:inputRichText component and saveOnsubmit in IE. When the form containing the input is submitted, I only get the original text and not any of the changes the user has made.

This is the code I use for displaying the input component:

Code:
<ice:inputRichText height="250" toolbar="Transfer" customConfigPath="/FCKconfig.js" id="messageBody" value="#{InvitationPageBean.messageBody}" language="sv" saveOnSubmit="true" />


I'm using IceFaces 1.8.2.

In other browsers, for example Firefox 3.6 and Safari 5, it all works as expected.

Any ideas?

Thanks!
Hi,

I'm facing an issue with the inputRichText component in IE8. It seems that after the browser has fired some partial submits for other components in the page the contents of the rich text editor. It looks correct to the user, but when the form is submitted the content is actually the same as the editor was initialized with. I've been unable to reproduce this in Safari, Forefox or Chrome.

I tried building a custom JavaScript that would fire the 'Save' command of the editor when the form is submitted, but the fails most of the time with errors such as "submit is null or not an object" or "Commands is null or not an object".

Here's the code I use for the rich text editor:
Code:
<ice:inputRichText height="250" toolbar="MyToolBar" customConfigPath="/FCKconfig.js" id="messageBody" value="#{BackingBean.messageBody}" language="sv" saveOnSubmit="true" />


And here's the JS for invoking save:
Code:
function ieAutoSave() {
     var oEditor = FCKeditorAPI.GetInstance('myForm:messageBody') ;
     oEditor.Commands.GetCommand('Save').Execute();
     return false;
 }


Any ideas?
Hi,

I'm having some problems with panelPopup and IE8. When I set autoCentre="true" and positionOnLoadOnly="true", I expect the popup to appear in the center of the view port and stay put there. This works fine in Safari, Chrome and Firefox, but in IE the popup "follows the scroll", if you see what I mean. I.e if the page where the popup is displayed is longer than the popup the popup is re-centered when I scroll the page. Also, and this is a bigger issue - if the popup is longer than the page I can only scroll part of the way down it, then it's re-centered. This means I can never see the information at the bottom of the popup...

This is the code used to generate the popup:
Code:
 <ice:panelPopup
     id="lecturePopup"
     positionOnLoadOnly="true"
     autoCentre="true"
     style="z-index:999; background: #FFFFFF;"
     resizable="false"
     draggable="false"
     modal="true"
     clientOnly="true"
     visible="#{SomeBean.popupRendered}" >
 


Any ideas?

Thanks!
I solved this using a periodic Ajax request to a servlet implementing the stuff outlined in this JIRA report: http://jira.icefaces.org/browse/ICE-47850

If there's a better way, please let me know... :)

Regards,
Markus
Hi,

I'm using the inputRichText component for composing HTML-formatted messages in a system I'm working on.

I've encountered a problem, however. It seems the session times out, even when the user is working in the editor.

I tried setting the session timeout parameter in web.xml to 1 minute and started typing in the editor. After 1 minute the "User session expired" dialog box appeared. Is there any way to make the rich text editor component keep the session alive?

This is the code I use to display the component in the page:
Code:
 <ice:inputRichText height="250" toolbar="Transfer" customConfigPath="/FCKconfig.js" id="messageBody" value="#{bean.messageBody}" language="sv" saveOnSubmit="true" />
 


Thanks!

brad.kroeger wrote:
The ice:outputStyle component does some browser sniffing and will apply a browser specific stylesheet. If your issue can be solved with css, please consult the tld. 


Thanks! I'm sure we can do it via CSS - I will check out the TLD.
Hi,

is there any built-in way in IceFaces to get information on what browser version the user has? We want to disable some functionality for users of IE6 and older.

Is this possible, or is a custom JavaScript the best way to go?

Thanks!
Hi,

is it possible to find out the id of the component calling a getter and / or setter method in a backing bean? For example, consider this:

I've got a form with lots of input fields for the user ti fill in. I want to display a message with an Effect if a field is filled incorrectly. My idea was to use a HashMap of Effects, with the invalid component id as key. However, in the JSPX page I need to get the correct Effect instance for each component, but I don't know the id of the calling component so I can't find it in the map...

Below is an example of how I figured the JSPX would look:
Code:
<ice:message style="color:FF0000;font-size:14px;" effect="#{ValidationBean.effect}" for="componentX" id="componentXError"/>


Am I doing this all wrong, or is there a simple way to do this, wothout having to do a unique getEffectForComponentX() method for each and every component that needs an Effect object?

Thanks!
Didn't notice your reply, sorry!

I started a new thread regarding this, it's located here [url]
http://www.icefaces.org/JForum/posts/list/16387.page[/url] and has more detailed error logs.

Thanks!
Just noted this in the server log:
Code:
2010-03-18 07:55:04,914 ERROR com.icesoft.faces.context.View.serve(83) Exception occured during rendering on http://xxx.xxx.xxx.xxx/block/css/fck_editorarea.css [/css/fck_editorarea.css]


Should the mapping of the "Blocking Servlet" be changed in any way?
I'm having issues with an IceFaces / JSF application. We have an IceFaces InputRichText component that is causing a lot of pain. Sometimes the page containing the component throws this exception and the page loading fails (it becomes all white):

Code:
[#|2010-03-18T10:44:40.197+0100|SEVERE|sun-appserver2.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=14;_ThreadName=httpSSLWorkerThread-80-0;RENDER_RESPONSE 6;/css/fck_editorarea.css;javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@75932728];_RequestID=45f3c97c-5cfc-4f25-a636-e76ec6b346eb;|JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /css/fck_editorarea.css) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@75932728]|#]
 [#|2010-03-18T10:44:40.204+0100|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpSSLWorkerThread-80-0;_RequestID=45f3c97c-5cfc-4f25-a636-e76ec6b346eb;|StandardWrapperValve[Blocking Servlet]: PWC1406: Servlet.service() for servlet Blocking Servlet threw exception
 java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.
 at com.icesoft.faces.context.View.servePage(View.java:152)
 at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:67)
 at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11)
 at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149)
 at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
 at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
 at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
 at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
 at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
 at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
 at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
 .
 .
 .
 Caused by: com.sun.facelets.FaceletException: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.
 at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:239)


Other times the loadin of the page works like a charm. To me it seems that the server for some reason tries to parse the CSS file as XML, which of course is doomed to fail miserably.

I have tried changing the servlet mappings in the web.xml file, as I've read reports on the Internet that it might fix the issue, but to no avail.

The servlet mappings section of the web.xml file is below:
Code:
<servlet-mapping>
     <servlet-name>Persistent Faces Servlet</servlet-name>
     <url-pattern>/xmlhttp/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>Persistent Faces Servlet</servlet-name>
     <url-pattern>*.iface</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>Persistent Faces Servlet</servlet-name>
     <url-pattern>*.jspx</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>Blocking Servlet</servlet-name>
     <url-pattern>/block/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>uploadServlet</servlet-name>
     <url-pattern>/uploadHtml</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.jspx</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
     <servlet-name>Persistent Faces Servlet</servlet-name>
     <url-pattern>*.jspx</url-pattern>
 </servlet-mapping>


We've also only ever encountered this on our servers (running CentOS and Windows 2k8), never on our dev machines (running XP and Vista). The only differance I can think of is that the servers run 64-bit JDK's.

Any ideas as to what might be going on?

Thanks!

I realize this is a very old thread, but I'm hitting this issue as well. Only one one server tough. On the production server running GlassFish 2.1.1 on Windows Server 2008 I see this. I have never encountered it on my dev machines (one running Windows Vista, one running OS X 10.6).

These are my servlet mappings in web.xml in case that helps:

<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

Thanks!
 
Profile for Malakim -> Messages posted by Malakim [20] Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team