PDA

View Full Version : Bug on xaction with combo box



rmazili
06-27-2007, 08:39 AM
Hello,

my friend found a bug in xaction when it have a combo box, if the data that will populate the combo box comes from database and the select statement returns only one datum, combo box don't populate, to test it, put a limit 1 on the select statement or put a where clause that will return only one datum and you can see what I'm talking about.

Sorry for my poor english.

Thanks

dmoran
07-02-2007, 03:17 PM
The default behavior if there is only one choice - is to not prompt and use that choice. In the xaction you can specify to prompt anyway. If you are using design studio, I think there is a check box for this.

Doug

rmazili
07-04-2007, 02:12 PM
Look, if you have a combo box that will be populated with a query, you probably don't know the number of rows that will be returned, the query can return one row or can return ten rows, but if return one row the problem that I reported occurs.
I suggested put the limit clause only to show how to simulate the problem, but to do a another test, do this:

create a table with one column named options
insert 5 options on this table

after that, select anyone of pentaho samples that contain a combo box and alter it to catch the options from the table that you created above.

It'll works great.

Now remove 4 options from the table and execute again the sample that you altered, the sample not will show the option that is on the table.

dmoran
07-10-2007, 12:11 PM
I think I understand perfectly. When your query returns 1 item, there is no prompt. When it returns more than 1 item, there is no prompt. There is even an example of this in the samples:

http://localhost:8080/pentaho/ViewAction?&solution=samples&path=secure&action=quadrant-budget-for-region-session.xaction

Log in as Suzy and there are 3 regions to choose from for the report. Log in as Joe and he only has only 1 region returned so there is no prompt. This is the default designed behavior. To change this behavior with the design studio, check the box titled "Prompt When One Choice"

If you are editing the XML it would look like this:

...
<component-definition>
<selections>
<REGION style="select" prompt-if-one-value="true">
<filter>REGION_FILTER</filter>
<title>Select the Region</title>
</REGION>
</selections>
</component-definition>
...

Let me know if that helps,
Doug