Forums / Developer / Limit attribute content depending on edit/view mode

Limit attribute content depending on edit/view mode

Author Message

Eirik Alfstad Johansen

Wednesday 16 November 2005 4:13:36 am

Hi,

I've developed a datatype which allows the user to select from a drop down list of items (fetched from a separate db table) in edit mode, and then displays the selected item in view mode.

Furthermore, I've created a template displaying a list of objects which includes an attribute built upon this datatype, and the line view of the object includes an attribute_view of the attribute.

The list of objects is fairly long, and the problem is that the script times out because it has to fetch the list of items for each instance of the attribute, even though it only needs to return the selected item (in view mode).

So, is there any way to have the datatype return the list of items only if the attribute is in edit mode?

Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/