[JBoss Seam] - Re: s:selectItems problems Seam 2 Beta1
by smithbstl
Ok, I got it working. I was not outjecting the department or departmentSection entities which was a problem.
I also had to rewrite the equals() method of DepartmentSection
public boolean equals(Object other) {
| if (other == null) {
| return false;
| }
| if (other instanceof DepartmentSection) {
| DepartmentSection that = (DepartmentSection) other;
| if (that.getDepartmentSectionId() != null && this.getDepartmentSectionId() != null) {
| return this.departmentSectionId.equals(that.departmentSectionId);
| } else {
| return (this == that);
| }
| } else {
| return false;
| }
| }
Since jsf does not guarantee how many times equals() will be called, it was being called 3 times during process validations but it was passing null objects in for "other" and at other times seam was passing proxy objects that were not null but the fields were not initialized.
Is there a more concise way to cover all the bases with equals()? Or should implement a similar method on all my entities?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079695#4079695
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079695
17Â years, 1Â month
[JBoss Portal] - Display swf within portlet
by anantj
All,
I have a sample portlet which should display a swf file. The portlet deploys without any problems but when viewed does not display the swf.
Here is my code
| HelloWorldPortlet.java
| public class HelloWorldPortlet extends GenericPortlet
| {
| protected void doView(RenderRequest rRequest, RenderResponse rResponse)
| throws PortletException, IOException, UnavailableException
| {
| try
| {
| rResponse.setContentType("text/html");
| javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/FirstChart.html");
| prd.include(rRequest, rResponse);
| }
| catch(Exception e)
| {
| e.printStackTrace();
| }
| }
| }
|
| helloworld-object.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portal Object 2.6//EN"
| "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
| <deployments>
| <deployment>
| <parent-ref>default.default</parent-ref>
| <if-exists>overwrite</if-exists>
| <window>
| <window-name>HelloWorldPortletWindow</window-name>
| <instance-ref>HelloWorldPortletInstance</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| </deployment>
| </deployments>
|
| jboss-portlet.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE portlet-app PUBLIC
| "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
| "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
| <portlet-app>
| <portlet>
| <portlet-name>HelloWorldPortlet</portlet-name>
| <header-content>
| <script type="text/javascript" src="/js/FusionCharts.js"></script>
| </header-content>
| </portlet>
| </portlet-app>
|
| <?xml version="1.0" encoding="UTF-8"?>
| <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
| http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| version="1.0">
| <portlet>
| <portlet-name>HelloWorldPortlet</portlet-name>
| <portlet-class>HelloWorldPortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>HelloWorld Portlet</title>
| </portlet-info>
| </portlet>
| </portlet-app>
|
| portlet-instance.xml
| <?xml version="1.0" standalone="yes"?>
| <!DOCTYPE deployments PUBLIC
| "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
| "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
| <deployments>
| <deployment>
| <instance>
| <instance-id>HelloWorldPortletInstance</instance-id>
| <portlet-ref>HelloWorldPortlet</portlet-ref>
| </instance>
| </deployment>
| </deployments>
|
| FirstChart.html
| <body>
| <div id="chartdiv" align="center">
| The chart will appear within this DIV. This text will be replaced by the chart.
| </div>
| </body>
|
Any help would be appreciated.
Thanks
Anant J
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079687#4079687
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079687
17Â years, 1Â month