« Return to Thread: SqlException in query with join and parameters.

Re: SqlException in query with join and parameters.

by Futaleufu_John :: Rate this Message:

Reply to Author | View in Thread

I have experienced problems with virtual forms and try to avoid them.

First, try getting rid of the virtual form and see if that helps.

Second, double-check to make sure you followed all the instructions in the blog. When I first started using radio buttons in tables and table select phase listeners, I invariably left something out.

If it still doesn't work, let's fix whatever's wrong and then reintroduce the virtual form.

I did debug and I found two problems.
I used a test page with a table and a button which deletes the selected row in the table
http://blogs.sun.com/winston/entry/single_selectable_row_table_component

1) The guide that I have followed is not working in this case because the setSelected method is not executed while it works when the query uses only one table. In this case the exception is not thrown but the action method "fails".

2) The exception (java.sql.SQLException: No value specified for parameter 1) is thrown if I use virtual forms.
In my true page there are other input components then use the virtual form.
The virtual form used in the test page includes the submit button and the radiobutton.
I used this virtual form on other pages where the query uses a single table and it works.
The exception is thrown (after the preprocess method and before the button action method) by

public PhaseId getPhaseId() {
        return PhaseId.RENDER_RESPONSE;
    }

in TableSelectPhaseListener.java

I cannot find an alternative way to select rows that do not use TableSelectPhaseListener

Tnx for your attention

Futaleufu_John wrote:
Take a look at the button action method that handles the submit.

Does that method do anything with the row set or data provider?

Anytime you execute the row set or, I think, refresh the data provider, you have to set the underlying query parameters.

Get a stack trace to see where in your code the exception is thrown.

jettero wrote:
rowset.execute() does not work for me

Any other ideas? I have read and re-read the documentation, but I was not able to understand where the problem is :(

 « Return to Thread: SqlException in query with join and parameters.