I am having troubles making this work. It seems that my resource bundle's getObjects method is never being called. This is the relevant portions of my code...

AccountTypeService.java
        public ListResourceBundle getResourceBundle() {
                final Select select = new 
Select(getDatasource()).from(TABLE_NAME)
                                .orderBy("name");
                return new ListResourceBundle() {
                        public Object[][] getContents() {
                                List<AccountType> objs = 
executeFetchAllBeans(select,
                                                AccountType.class);
                                ListIterator<AccountType> it = 
objs.listIterator();
                                Object[][] results = new Object[objs.size()][2];

                                System.out.println("Getting account types: " + 
objs.size());

                                int idx = 0;
                                while (it.hasNext()) {
                                        AccountType at = it.next();
                                        System.out.println("Type: " + 
at.getName());
                                        results[idx] = new Object[] {
                                                        "accountTypeId:" + 
at.getId(), at.getName() };
                                        idx += 1;
                                }

                                return results;
                        }
                };
        }

AccountEdit.java:
        public void processElement() {
                final Template t = getHtmlTemplate("account.edit");

                if (hasSubmission()) {
                        // Save account
                } else {
                        account = new AccountService().get(accountId);
                }
                t.addResourceBundle(new 
AccountTypeService().getResourceBundle());
                generateForm(t, account);

                print(t);
        }

account/edit.html:
                        <td><r:v name="FORM:SELECT:accountTypeId"></r:v></td>


Any thoughts?

Thanks,

Jeremy

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to