voyent
Messages posted by: qpid  XML
Profile for qpid -> Messages posted by qpid [16] Go to Page: 1, 2 Next 
Author Message
Hallo forum users,

I searched for a solution that gives me the possibility to call JavaScript on the mouse over or out event on a row.

The solution is not pretty but works:
Code:
 <ice:rowSelector mouseOverClass="';alert('#{value.id}');'" />
 


Result
Code:
 onmouseover="this.className=' iceRowSelMouseOver ';alert('23423');''"
 


Kind of Good JavaScript Injection;-)

regards
Can someone confirm this behaviour or is the scenario inadequately described?

Or maybe I misunderstand the functionality of including a JavaScript Lib within the FacesContext?
Hi Icefaces team and forum users,

I load a JavaScript file with the JavascriptContext.includeLib method. That works as expected.

After a redirect navigation the lib is still included.

Is there a way to remove an included JavaScript lib?

reagards qpid
No, we are using directly tomcat without Apache httpd or other reverse proxys in front of the tomcat.

Hello forum users and icefaces team,

in the Mac Safari and KDE Konqeuer browser we have critical problems, if the url is specified without the port number. The page is shown correctly. But no user actions will received by the server side. For example the RowSelector and tab changing are not working.

This behavior only happens in asynchronous modus. If you specifie the port in the url (port 80) it runs as expected.

http://domainname.com/main.iface (won't run)
http://domainname.com:80/main.iface (runs as expected)

Configuration, used components and versions:
Linux 2.6.24-etchnhalf.1-amd64 x86_64 GNU/Linux
Apache Tomcat 6.0.18
Apache ActiveMQ 5.1.0
IceFaces 1.7.1
AHS (from IceFaces 1.7.1 package)

Code:
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns="http://java.sun.com/xml/ns/j2ee"
 	xmlns:javaee="http://java.sun.com/xml/ns/javaee"
 	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_3.xsd"
 	id="WebApp_ID">
 	<servlet>
 		<servlet-name>Faces Servlet</servlet-name>
 		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.webapp.xmlhttp.BlockingServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet>
 		<servlet-name>uploadServlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.component.inputfile.FileUploadServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 
 	<servlet>
 		<servlet-name>Tomcat Push Servlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.webapp.http.servlet.TomcatPushServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 
 	<!-- ::::::::::::::::: -->
 	<!-- Extension mapping -->
 	<!-- ::::::::::::::::: -->
 
 	<servlet-mapping>
 		<servlet-name>uploadServlet</servlet-name>
 		<url-pattern>/uploadHtml</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>/xmlhttp/*</url-pattern>
 	</servlet-mapping>
 	<servlet-mapping>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<url-pattern>/block/*</url-pattern>
 	</servlet-mapping>
 	<welcome-file-list>
 		<welcome-file>index.jspx</welcome-file>
 	</welcome-file-list>
 	<security-constraint>
 		<web-resource-collection>
 			<web-resource-name>Secure area</web-resource-name>
 			<description>Secured Pages</description>
 			<url-pattern>/index.jspx</url-pattern>
 			<url-pattern>*.iface</url-pattern>
 			<http-method>POST</http-method>
 			<http-method>GET</http-method>
 		</web-resource-collection>
 		<auth-constraint>
 			<description>Existing Roles</description>
 			<role-name>user</role-name>
 			<role-name>administrator</role-name>
 		</auth-constraint>
 	</security-constraint>
 	<login-config>
 		<auth-method>FORM</auth-method>
 		<form-login-config>
 			<form-login-page>/loginpage.iface</form-login-page>
 			<form-error-page>/loginError.iface</form-error-page>
 		</form-login-config>
 	</login-config>
 	<security-role>
 		<description>The standard user role</description>
 		<role-name>user</role-name>
 	</security-role>
 	<security-role>
 		<description>The administrator role</description>
 		<role-name>administrator</role-name>
 	</security-role>
 	<context-param>
 		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
 		<param-value>.jspx</param-value>
 	</context-param>
 	<context-param>
 		<description>
 			State saving method: "client" or
 			"server" (= default) See JSF Specification 2.5.2
 		</description>
 		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
 		<param-value>server</param-value>
 	</context-param>
 	<context-param>
 		<param-name>com.icesoft.faces.debugDOMUpdate</param-name>
 		<param-value>false</param-value>
 	</context-param>
 	<context-param>
 		<description>
 			Set this flag to true, if you want the JavaServer Faces
 			Reference Implementation to validate the XML in your
 			faces-config.xml resources against the DTD. Default value is
 			false.
 		</description>
 		<param-name>com.sun.faces.validateXml</param-name>
 		<param-value>true</param-value>
 	</context-param>
 	<context-param>
 		<description>
 			Set this flag to true, if you want the JavaServer Faces
 			Reference Implementation to verify that all of the
 			application objects you have configured (components,
 			converters, renderers, and validators) can be successfully
 			created. Default value is false.
 		</description>
 		<param-name>com.sun.faces.verifyObjects</param-name>
 		<param-value>false</param-value>
 	</context-param>
 	<context-param>
 		<param-name>com.icesoft.faces.uploadDirectory</param-name>
 		<param-value>upload</param-value>
 	</context-param>
 	<context-param>
 		<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
 		<param-value>true</param-value>
 	</context-param>
 	<context-param>
 		<param-name>com.icesoft.faces.synchronousUpdate</param-name>
 		<param-value>false</param-value>
 	</context-param>
 
     <context-param>
         <param-name>com.icesoft.net.messaging.properties</param-name>
         <param-value>activemq.properties</param-value>
     </context-param>
 	<context-param>
 		<param-name>
 			com.icesoft.faces.blockingRequestHandler
 		</param-name>
 		<param-value>icefaces-ahs</param-value>
 	</context-param>
 	<context-param>
 		<param-name>
 			com.icesoft.faces.blockingRequestHandlerContext
 		</param-name>
 		<param-value>async-http-server</param-value>
 	</context-param>
 
 	<listener>
 		<listener-class>
 			com.icesoft.faces.util.event.servlet.ContextEventRepeater
 		</listener-class>
 	</listener>
 
 	<session-config>
 		<session-timeout>10</session-timeout>
 	</session-config>
 </web-app>
 


best regards
its not clear for me what you are mean with what is the difference? Are you asking yourself or really didn't see the difference. In second case:
<from-view-id>/site.iface</from-view-id>
=>
<from-view-id>/site.jspx</from-view-id>

regards qpid
Hi JerryPan,

try to use in the from-view-id the name of the site extended by jspx

this one is working for me:

Code:
<navigation-rule>
 		<from-view-id>/site.jspx</from-view-id>
 		<navigation-case>
 			<from-outcome>next</from-outcome>
 			<to-view-id>/var_ds.iface</to-view-id>
 <redirect />
 		</navigation-case>
 	</navigation-rule>


regards qpid
I prefer the BeanComperator from the apache commons project:
http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#collections

create the list, fill it with your beans and than sort it with the Collections.sort(list, beanComparator) method

run over the list and create your selectItems...

pay attention to null values on the sorted property in the beans

Code:
 public class NullSafeBeanComparator extends BeanComparator {
 
 	public NullSafeBeanComparator(String property) {
 		super(property, new NullComparator());
 	}
 
 	public int compare(Object o1, Object o2) {
 		if (getProperty() == null) {
 			// compare the actual objects
 			return getComparator().compare(o1, o2);
 		}
 
 		try {
 			Object value1 = null;
 			Object value2 = null;
 			try {
 				value1 = PropertyUtils.getProperty(o1, getProperty());
 			} catch (NestedNullException e) {
 			}
 
 			try {
 				value2 = PropertyUtils.getProperty(o2, getProperty());
 			} catch (NestedNullException e) {
 			}
 
 			return getComparator().compare(value1, value2);
 		} catch (Exception e) {
 			throw new ClassCastException(e.toString());
 		}
 	}
 }


regards qpid
Hello abhisheksinha,

the locale attribute of f:view expects an object of type java.util.Locale.

I use the following code (found in this forum) to offer dynamic changing locale:

main.jspx/xhtml
Code:
<f:view locale="#{localeBean.locale}">
 	<f:loadBundle basename="ApplicationMessages" var="bundle" />
 ...
 <ice:selectOneMenu value="#{localeBean.selectedLocale}"
 					partialSubmit="true">
 					<f:selectItems value="#{localeBean.locales}" /></ice:selectOneMenu>
 


LocaleBean.java is attached.

regards qpid
Hi froum users and icefaces team,

is there a way to combine a rowSelector and a column grouping?
The simple way without any additional work results in the attached image.

Only the first row of a set of grouped columns results in a complete selected row (included the grouped coulmns). If any of the following rows is selected the grouped columns will be unselected.

Of course this behaviour is understandable but maybe there exists a nice workaround.

Case 1: the grouped columns will be selected, too
Case 2: the grouped columns will never be selected

In case 2 the question would be: Is there a way to limit the rowSelector to certain coulmns?

I think to establish case 1 there has to be a little bit more work... but i am not sure.

regards qpid
I think this behaviour is the same I described in this thread: Navigation redirect to previous page

The redirect is executed but the view is also restored. You can test this, if you pass a parameter thru the navigation case.

I tried also a redirecting thru the redirect method:

Code:
			FacesContext.getCurrentInstance().getExternalContext().redirect(
 					"/test/pageA.iface");


But the result is always the same: No complete redirect!

regards qpid
Hello again,
after a while of working on another project i am now back to this issue. For better testing and demonstrating I created a war file. So I hope my problem will become more clear.

Like I said this navaigation case worked in a previous version of icefaces. but I was not able to create also a war file with 1.6.2 or earlier, cause of some detail changes from 1.6.x to 1.7 which I do not know anymore. So the webapp will not start with 1.6.2 cause of some unclear issues...

regards qpid

Hi forum users and icefaces team,

after the update to 1.7.0 a former running navigation case wont work anymore. I am not sure which was the last working version with this navigation case. The only thing I can say for sure is that it worked in 1.6.x.

I use for navigation the "navigation-rule" in the faces-config.xml file.

The situation is the following:

The navigation goes from PageA to PageB with no redirect, because of some parameter. Comparable with a master and detail view. From PageB back to PageA is a redirect to ensure destroying the pageBBean.

The strange thing is that if I redirect to another page excepting pageA the redirect works like expected. But it dont work if I try to redirect back to page A.

pageA.jspx Code:
...
 <ice:commandLink value="detail" action="go_PageB">
 <f:param name="selectedid" value="#{pageABean.selectedid}"
 </ice:commandLink>...
 


pageB.jspx Code:
...
 ice:outputText value="#{pageBBean.id}" />
 <ice:commandLink value="back" action="go_PageA">
 </ice:commandLink>...
 


pageBBean Code:
 <managed-bean>
 	<managed-bean-name>pageB</managed-bean-name>
 	<managed-bean-class>
 		PageB
 	</managed-bean-class>
 	<managed-bean-scope>request</managed-bean-scope>
 	<managed-property>
 		<property-name>id</property-name>
 		<value>#{param.selectedid}</value>
 	</managed-property>
 <managed-bean>
 



Navigation rule Code:
 <navigation-rule>
 	<from-view-id>*</from-view-id>
    
 	<navigation-case>
 		<from-outcome>go_PageB</from-outcome>
 		<to-view-id>/pageB.iface</to-view-id>
 	</navigation-case>
 
 	<navigation-case>
 		<from-outcome>go_PageA</from-outcome>
 		<to-view-id>/pageA.iface</to-view-id>
 		</redirect>
 	</navigation-case>
 </navigation-rule>
 


thanks ahead!

regards qpid
The Firebug addon is really good. I used until now only the webdeveloper addon. It goes quiet better with the Firebug addon to design it. Also it helped a lot to understand the system of how icefaces handles with css;-)

I breaked my work at this issue as I noticed that putting a checkbox or a an input field in a menuItem is also a problem.

I'm not sure if I should start another thread for this issue relating to other users with the same question.

regards qpid
I think what you need is a ice:rowSelector

Code:
<ice:rowSelector  value="#{value.selected}" ... selectionListener="#{value.rowSelected}">


Code:
public void rowSelected(RowSelectorEvent event) {
 for (Bean beanl : beans) {
 			if (bean.isSelected()) {
 				... do your stuff here ...
 			}
 		}
 }


Your bean have to implement isSelected() and setSelected(). So the rowSelector mark the clicked bean (row)

regards qpid

 
Profile for qpid -> Messages posted by qpid [16] Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team