Ricardo Preston

Greenhorn
+ Follow
since Jan 11, 2010
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ricardo Preston

I have a list of records (1 per line), and each one can be selected and then modified on a separate page. When I modify a record and click the Save button, I'm taken back to the original list (a datatable) which should include the updated record.

Once I click 'Save', the application:
1- Saves the record to DB
2- Re-queries the search list to load the list of records from DB and show in the list page (showing the modified record with latest values).

The issue is that, the modified values are not displayed. The query still returns the old records. Until I open a new browser and re-query, the new changes are not reflected in the list page (even though the changes have gone to the DB).

I use 2 stateful session beans, one to update record (in a long running conversation) and the other that queries the list.

Upon redirecting to the list page I call the query method so that the new values must be shown. I do this via the pages.xml since if I call re-query in the update method, the query() will be in the same conversation. So I first end the Conversation and then call the query() upon loading of the list page (so that they are in two conversations).

In pages.xml :



In update method :



Is this due to objects still being held in Conversation Scope though the Conversation has ended? Or is this because the DB has not committed the transaction yet? How to overcome this problem so that new values are shown? Can someone please help?
Yes, I do if I'm using the FormKey class, as well as uncommenting the @EmbeddedId line.
Hi all. I'm having great difficulty trying to map a ManyToOne relationship between 2 classes, when one class has a composite primary key. I'm running JBoss 5.0 and Seam.

I have a Form class that has many Rules. If at first I ignore the composite key and just use 1 field as the key, all is fine (though of course I get multiple matches instead of one). The code looks something like this:



Now if I uncomment the 2nd @JoinColumn annotation, I get the error:

org.hibernate.AnnotationException: A Foreign key refering xxx.yyy.Form from xxx.yyy.Rule has the wrong number of column. should be 1



If I create a PK class FormKey.java to hold the form name & version, I then don't know how to construct the annotations in Rule, since I'm no longer joining columns directly, but mapping to a class Form.key instead.

Any ideas? Thanks.
Hi. In seam, I'm trying to validate a filename when it's selected in a s:fileUpload, before it's submitted.

I can get the method called on onchange(), but the value I've set (the fileName) is still undefined. Is there a way to do this?

Thanks.




In the UploadRules bean, I have getters & setters for these variables:


And the method that gets called when the filename is selected (before it's uploaded by clicking the submit button). Neither variable is set ... and there's my problem. Ideas?

Hi. Using seam/RichFaces, I'm trying to validate a filename when it's selected in a s:fileUpload, before it's submitted.

I can get the method called on onchange(), but the value I've set (the fileName) is still undefined. Is there a way to do this?

Thanks.




In the UploadRules bean, I have getters & setters for these variables:


And the method that gets called when the filename is selected (before it's uploaded by clicking the submit button). Neither variable is set ... and there's my problem. Ideas?

12 years ago
JSF
Fixed the prob myself. I should have been using onclick event, not onchange.
12 years ago
JSF
Hi y'all.

I'm using seam/JSF (Rich Faces), latest versions. I have a h:selectOneRadio tag with 2 values, and I want to use Ajax to display one of 2 different forms, depending on the selection in the radio button. The problems are:

1. The first time I change the value, nothing is triggered in the backing bean;
2. Subsequent changes do trigger, but are the opposite of what they should be! e.g. If I select Key, the backing bean shows that it is being changed from key to advanced, not the other way around.

Can anyone help? Thanks.

Here's the facelet code:


And 'ere's the backing method:

12 years ago
JSF