| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/26/2009 09:45:46
|
kuben@itaware.co.za
Joined: 03/26/2009 05:40:00
Messages: 11
Offline
|
Hi
I would like to be able to populate a Combox with values from a database table. I have tried the following but cannot get the values to appear:
My JSP has:
<e:combobox ajax="true"
editable="true"
labelFieldName="financial_year"
keyFieldName="financial_year"
id="yearCombobox"
labelText="Please select a Year!"
dataModel="#{DataBean.sqlDataModelMasterYear}">
</e:combobox>
My backing bean has the following code:
public SQLDataModel getSqlDataModelMasterYear() {
if (sqlDataModelMasterYear == null) {
sqlDataModelMasterYear = new SQLDataModel();
sqlDataModelMasterYear.setSqlSelect("SELECT financial_year FROM master_year");
}
return sqlDataModelMasterYear;
}
I would also like to find out how to make comboboxes dependant on each other, for example if I select a combobox with months another combobox with the corresponding no. of days must appear.
Thanks
Kuben
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/26/2009 13:24:18
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
To make combo dependants on each others, you have to do something like this:
<e:combobox id="first" .........
valueChangeListener="#{ComboDataBean.renderCombo}">
</e:combobox>
<e:combobox id="second" .........
rendered="#{ComboDataBean.rendered}">
</e:combobox>
//ComboDataBean
...
private boolean rendered;
//getter and setter
public void renderCombo(ValueChangeEvent evt){
setRendered(true);
}
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 06:29:13
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
About getting sqlDataModelMasterYear, do you have any error in console?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 08:22:36
|
kuben@itaware.co.za
Joined: 03/26/2009 05:40:00
Messages: 11
Offline
|
Hi
There is no errors in console at all.
It creates the correct number of items in the combobox.
For example the table MASTER_YEAR has five records, and when I click on the combobox it has fives lines, but each value is blank. I can't seem to populate the item values.
Is my code correct?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 10:43:17
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
Your code is correct. I've send you a patch by email. Delete all your caches before using it. Let me know if it works fine now.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 11:11:57
|
kuben@itaware.co.za
Joined: 03/26/2009 05:40:00
Messages: 11
Offline
|
Hi Adina
Still does not work.
It now gives me the following error:
java.lang.ClassCastException
simplica.util.base64.Base64 cannot be cast to ResourceBundle
I'm using Glassfish V2 (Sun Java Application Server 9.1) to run it. Can that cause any problems?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 12:24:21
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
I've sent another .jar. We forgot to remove some files, that's why you got the error. The problem is not related with Sun Application Server/ Glassfish.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 12:48:28
|
kuben@itaware.co.za
Joined: 03/26/2009 05:40:00
Messages: 11
Offline
|
Hi
Still giving same error as before.
It says possible source of error is:
Class Name: java.util.ResourceBundle$Control
File Name: ResourceBundle.java
Method Name: newBundle
Line Number: 2391
Could you send me a test example that you are using, then I can try it on my side to see whether it gives errors or not.
Thanks
Kuben
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 03/27/2009 14:21:59
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
I guess you are using jdk 1.6. Please change it to jdk 1.5, and try once again. It might be a compatibility issue.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 04/01/2009 06:18:17
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
I reproduced and fixed the error with ResourceBundle. I've sent you a new patch file by email.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/19/2009 09:09:27
|
kuben@itaware.co.za
Joined: 03/26/2009 05:40:00
Messages: 11
Offline
|
Hi
When I populate my combobox, it has a limit of 50 lines. I am populating the combobox using a sqlDataModel.
Is this a bug?
I am using patch 1.7.20
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/21/2009 05:24:21
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
Yes, it seems to be a bug. You'll get a patch as soon as it gets fixed.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/25/2009 11:29:16
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 183
Offline
|
I've send you a patch by email.
This fix will be available for everyone starting with ECruiser version 1.1.10 .
|
|
|
 |
|
|