cocoon-dev mailing list archives

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

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:

...
<fd:on-value-changed>
 <fd:javascript>
   var value= ....
   myWidget.setSelectionList("cocoon:/mySelectionList?id=" + value);
   .....
 </fd:javascript>
</fd:on-value-changed>
...

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.

WDYT?

Best Regards,

Antonio Gallardo.

Mime
View raw message