cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject [RT] Cache Cforms selection-list created at runtime using Javascript
Date Tue, 07 Jun 2005 07:57:23 GMT

We use javascript for creating a SelectionList (SL) at runtime. We do this
mainly because we want dynamically change the @src of the SL. If the @src
is change because an user input, then we can use the on-value-changed
event to do this. Example:

   var value= ....
   myWidget.setSelectionList("cocoon:/mySelectionList?id=" + value);

In samples without a repeater as the car selector, there is no need for
caching the item list values. The SL is used in only 1 widget and it is
not repeated again.

The situation change if the same field is inside a repeater. And here we
can again improve the SL performance, by caching the item list. Of course,
this functionality should be optional, so we need another javascript
function to create a cached SL. Maybe something like this:

myWidget.setSelectionList(src, cache);

where cache = ["request"|"none"];

Note: "static" has no sense here.

As before, the solution can be implementing by obtaining the context. Then
we should be able to reuse the current caching code.


Best Regards,

Antonio Gallardo.

View raw message