Greenhorn
since May 20, 2011
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by Solomon Gnanadurai

Yes, I should not add if the code "ABC" with no end date is already present. But let me take this example. In my set let's suppose I have an element with code "ABC" and with an end date then I come across another element with code "ABC" with no end date then the result should have the code "ABC" with no end date. Basically if the code is same then the result should have the one with no end date.

Example:
ClassA Obj1: PlanA = code=AAA, startDate=2010/12/10, endDate=2011/12/10, PlanA =code=BBB, startDate=2010/12/10 endDate=<null>
ClassA obj2: PlanA = code=AAA, startDate=2011/12/10, PlanA= code=CC, startDate=2011/12/10 endDate=<null>, PlanA= code=BBB, startDate=2010/12/10 endDate=2011/12/10,PlanA= code=DDD, startDate=2010/12/10 endDate=2011/12/10

After merging the result should look like:

ClassA obj3: PlanA=code=AAA, startDate=2011/12/10, PlanA= code=CC, startDate=2011/12/10 endDate=<null>,PlanA= code=BBB, startDate=2010/12/10 endDate=<null>,PlanA= code=DDD, startDate=2010/12/10 endDate=2011/12/10
5 years ago
I haven't yet tried to use a for loop and remove the duplicates as per my requirements. I was wondering if there is way to use the equals() & hashcode() to get the result that I wanted.
5 years ago
I did try using just code and lastDay but didn't work as expected.
Do you have any other solution? Appreciate your help.
5 years ago
If I understand your reply correctly, are you saying I have to manually use a for loop to go over the set and do the manipulation as per my requirements? Is there any other way to accomplish my requirements? Thanks
5 years ago
I am looking for a solution to my below requirements.

I have a class similar to `ClassA` below

And I have two objects `(obj1, ojb2)` of `ClassA`. The requirement is to merge the two objects and remove the duplicates.

Example:

ClassA Obj1: PlanA = code=AAA, startDate=2010/12/10, endDate=2011/12/10, PlanA =code=BBB, startDate=2010/12/10 endDate=<null>
ClassA obj2: PlanA = code=AAA, startDate=2011/12/10, PlanA= code=CC, startDate=2011/12/10 endDate=<null>, PlanA= code=BBB, startDate=2010/12/10 endDate=2011/12/10,PlanA= code=DDD, startDate=2010/12/10 endDate=2011/12/10

After merging the result should look like:

ClassA obj3: PlanA=code=AAA, startDate=2011/12/10, PlanA= code=CC, startDate=2011/12/10 endDate=<null>,PlanA= code=BBB, startDate=2010/12/10 endDate=<null>,PlanA= code=DDD, startDate=2010/12/10 endDate=2011/12/10

Important Requirement:

When removing the duplicates it should also check if the endDate is present. If the endDate is present then remove that object from the list. For example, the above example has Obj1 PlanA = code=AAA, startDate=2010/12/10, endDate=2011/12/10 and Obj2 PlanA=code=AAA, startDate=2011/12/10 Now the result after merging should have code=AAA, startDate=2011/12/10

I have the below code but it is not creating the result as mentioned in the above important section. Please share with me how to accomplish the result as expected. Thanks for your help

5 years ago

That was a good post which I already referred to generate the pdf. The solution I am trying to find out is how to skip opening the new window when there are validation errors.
7 years ago
I have a CustomerInfo form with UI fields required=true and few command buttons. When clicking one of the command buttons I am calling backing bean method to create a pdf and to open it in a new window which is working fine. But when no values are entered in the required fields, it still opens a new window with CustomerInfo form re-rendered along with <h:messages> (required field messages).

I dont want to open a new window when there are validation errors.

I am using JSF 1.2 Facelets and RichFaces 3.3 in my project.

7 years ago
I have one scenario where I have selectManyListbox and on double clicking should call the bean method and load the next page based on the from-outcome value from that method. FYI, there is no submit button in the page.

I am using jsf 1.2 Facelets & Richfaces 3.3
7 years ago
Opening a new thread as this post seems to be closed
7 years ago
I am able to use RichFaces Ajax and rerender partial page when the user clicks selectBooleanCheckbox.

But I have one more scenario where I have selectManyListbox and on double clicking should call the bean method and return to the next page based on the <from-outcome> value from that method. FYI, there is no submit button in the page.
7 years ago
Yes after checking their manual I found that I am not using commons-digester-1.8.jar. So using the right version solved the weblogic deployment problem.

Also I am able to execute backing bean method using RichFaces like this

Thanks Tim for all the inputs that you have been giving so far.
7 years ago
Tim, thanks for your reply. As you suggested I am going to use RichFaces but I had few issues when deploying in weblogic 10.3.1 and I was able to resolve most of the issues but I am stuck with the below exception when deploying in weblogic. Any help is appreciated.
I am using the below jar files to use RichFaces.
commons-collections-3.2.1
jhighlight-1.0
guava-r09-gwt
guava-r09
richfaces-api-3.3.3.Final
richfaces-impl-3.3.3.Final
richfaces-impl-jsf2-3.3.3.Final
richfaces-ui-3.3.3.Final
commons-digester-2.0
commons-logging-1.1.1

Exception:
java.lang.NullPointerException
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerConfig(ResourceBuilderImpl.java:211)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerResources(ResourceBuilderImpl.java:155)
at org.ajax4jsf.resource.ResourceBuilderImpl.init(ResourceBuilderImpl.java:226)
7 years ago
JSF 1.2 & Facelets -

I have two similar questions listed below.

1. How can I execute a backing bean method when a user double clicks on a selectManyListbox?

I know we can code like ondblclick="document.getElementById('formid').submit()" but I dont have a submit button in my page. And I am not using AJAX.

2. How can I execute a backing bean method when value changes in h:selectBooleanCheckbox without submitting the form?

Thanks.
7 years ago
Tim, thanks for your suggestion to use ListDataModel. I followed this post on how to use ListDataModel http://numberformat.wordpress.com/2010/08/25/using-jsf-to-display-table-data/ and I have resolved the issue. I will update this thread if I ran across again the intermittent issues I had before. Thanks
7 years ago
Tim, currently I am using the PackageVO list in so many other parts of the code and my datamodel looks like the below. Can you suggest me exactly what code changes I have to make? Thanks
7 years ago