On 4/19/06, Khai Wan <[EMAIL PROTECTED]> wrote:
> I cannot get the tomahawk work within the framework of
> facelets/myfaces. Perhaps I might be using the wrong jar file etc..

Make sure you've manually specified a tomahawk.taglib.xml file.  
There's an example on the wiki. (something like
"Using_facelets_with_tomahawk")

> Our web application requires the dynamically creation of select items (eg.
> many different types of select items). These items are at times a very long
> listing. So putting it into the session or application is not feasible as it
> will take alot of memory. Instead, I have no other choice but to re-query
> the listing from the database each time the request comes in. In my example,
> I have to repopulate the dataItems again.

Yes, I have the same situation, and I do it by creating *ItemProvider
class beans with methods similar to this.   If the scope of the bean
is request, then the data is fetched once.  If session, once per
session.  If application, once per application.   Or it can be
preserved across requests by using t:saveState.

    private SelectItem[] announcementItems = null;
    public SelectItem[] getAnnouncementItems()
    {
        if (null == announcementItems)
        {
                announcementList = coreCustomerDataStore.getAnnouncementList();

                announcementItems = new SelectItem[announcementList.size()];
                for (int index = 0; index < announcementList.size(); ++index)
                {
                    Announcement announcement = (Announcement)
announcementList.get(index);
                    announcementItems[index] = new SelectItem(announcement,
announcement.getUIDisplayLabel());
                }
        }

        return announcementItems;
    }

Reply via email to