This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Anil Gorthy

Greenhorn
+ Follow
since Oct 30, 2008
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 Anil Gorthy

Hi Rajneesh,

When that bean was placed in the session, I was able to retrieve the values of the selected row however, as you have rightly mentioned, that is a workaround. So, I will go back and convert this bean to request scope.

Thank you!

Best,
Anil.
12 years ago
JSF
Jeff,

I do not have a definitive answer on how you can resolve this but I chanced upon this very helpful tutorial and I hope you too will:

JSF_Rendered_Performance

Best,
Anil.
12 years ago
JSF
Thank you all for attempting to provide a solution. The reason I could only see null whenever a row was selected is due to my backing bean not being in a session scope. After changing it to session from request, I was able to capture the selected row.

The relevant part in my faces-config.xml:There was also one other discussion on MyFaces - Users mailing list that was very helpful and which clarified that I should use session scope was:
[url=http://www.nabble.com/Table%27s-data-not-displayed-upon-setting-"binding"-attribute-with-tr:table-td2470023.html]MyFaces-Table-Binding[/url]

Just as an FYI, as mentioned by this user, I too have used both value="#{adminBean.names}" and binding="#{adminBean.table}".

What I have not been able to accomplish was refreshing the table whenever the delete operation is completed. Since this table is displayed only when a user selects an item in the listbox, they currently will have to select a different item in the listbox for this table to refresh. Not a pretty UI experience but I will get to it.

I have completed the Delete row part and the Edit row is pending however, retrieving the selected rows' values was the critical piece.
12 years ago
JSF
Hi:

My application is a standard MVC app which uses Apache Trinidad as its front-end. A few weeks backs I posted a question about displaying buttons in a table based on a if-else condition and I was told to use DataModel and I have used it: Display_if_else_condition

Now, when I am trying to delete/edit a row, I am unable to capture the selected row in the backing bean. When I am trying to read the table using getRowData() it is returning null. Here is the code in my JSPX file:

And in the backing bean (this code is from Trinidad's dev page: Trinidad_Tables):

I need to capture the selected row - which in my application is a DTO and send it to the DAO for deletion. Can you please let me know what I am doing incorrectly here that I cannot capture the selected row? Thank you in advance for your time!

FYI, I cross-posted this question on Sun's JSF Forums as well: Cross-post_Sun_JSF_Forum

Best,
Anil.
12 years ago
JSF
Your understanding of my requirement is correct, Tim. Thank you!

I was not using DataModel and hence was struggling to capture the selected row to perform either edit or delete of that row.
12 years ago
JSF
You should be able to achieve this w/ PartialTriggers (FYI, I use Apache Trinidad). Here is a snippet of my JSF code:

First ListBox:


Second ListBox:


Notice the second listbox: I have the partialTriggers attribute set to the id of the first listbox and in the backing bean whenever the user selects a value in the first listbox, this valuechange is captured and sent to populate the second box.

Hope this helps.
12 years ago
JSF
Matt:

I do not know anything about RichFaces so please pardon my ignorance but from your use case, I think PartialTriggers is what you are looking for.

I use Apache Trinidad components which has built-in AJAX support and it provides two attributes: autoSubmit and partialTriggers to accomplish repainting a component based on the response received.

I am certain a4j has attributes/tags that will meet your requirements.

Best,
Anil.
12 years ago
JSF
Hello Ravi,

Firstly, this is not a JSF related error. There could be several reasons why you are getting a ClassCastException. It may help if you copy/paste your stack trace or look at the stack trace yourself for text beginning with "at <classname>".

I suspect your iterating through the ResultSet and adding them to the ArrayList is not appropriate. Break that step into multiple and ensure that you are retrieving Strings from the ResultSet and adding them to GetData() method before adding this object to the ArrayList. That is a lot of computation in one step.

Best,
Anil.
12 years ago
JSF
Here are couple of my oft-visited links:

http://jsftutorials.net/
http://wiki.apache.org/myfaces/
12 years ago
JSF
Hello:

My application is a standard MVC app which uses Apache Trinidad as its front-end. Here is my requirement: based on the parameters selected from the list boxes in the UI, I need to display a tabular data w/ edit and delete buttons if there is data in the DB else, need to accept input from the user.

I am not sure how I can accomplish this - do I create a <tr:switcher> that will be set (programmatically) in the backing bean based on whether there is data or not for the selected parameters?

Thanks in advance for your help!
12 years ago
JSF
Yeah, I agree with Jeanne, SQL Developer is definitely a good tool.
13 years ago
Vinod,

I am working on a similar requirement and given below is my approach but I am not sure if it will provide the solution that fits your needs.

1. Parse the CSV using one of the open source CSV Parsers:

http://opencsv.sourceforge.net/
http://ostermiller.org/utils/CSV.html

2. Create POJOs from this parsing tool and

3. Convert the POJO to an XML while validating against a XSD. I will check the POJOs for conformance with the Schema (XSD in my case) as I am creating the XML.

Hope this helps.
Our application is a standard J2EE application using MyFaces for the front-end and third-party JARs for developing Charts on the UI within the browser. The applet receives parameters based on user selection and the applet calls a servlet with these parameters and the servlet gets data from Database.

The Applet code is able to receive data from DB and the applet status (in the browser's status bar) is started but I see a grey box instead of the chart applet.

I see no exceptions in the Java console yet the page loads with a grey box. Can someone please guide me? Please let me know if you need more information.
13 years ago