Prevent suggestbox from retrieving data on initialization

Hi,

I am using the client framework 4.4.1, but it also applies to other versions. It's rather an inconvenience than a problem. I am developing an application which on some screens make heavy use of suggestboxes. Each suggestbox is retrieving data when the screen is rendered which makes the screen slow to appear. Is here any way to prevent the data to be retrieved on initialization, but retrieve the data the first time when the user starts using it?

Thanks,
Tobias.

Anyone has

a suggestion?

suggestion

Hi twolff,

The example below shows how to do so. It loads the data source when the suggestbox gets focused:

<b:suggestBox >
   <e:handler event="focus" type="application/javascript">
   <![CDATA[
  if(this.getProperty('childNodes').length == 0){
                bb.command.create('<b:dataSource xmlns:b="http://www.backbase.com/2006/btl" xmlns:e="http://www.backbase.com/2006/xel" xmlns:xi="http://www.w3.org/2001/XInclude" e:behavior="b:localData" dataType="application/xml" name="dataSourceS"> \
          <b:dataContainer> \
             <xi:include href="suggestbox/suggestBoxData.xml" /> \
          </b:dataContainer> \
        </b:dataSource> \
        ',this);
  }
  ]]></e:handler>
</b:suggestBox>

The important thing here is first you don't need to define any dataSource attribute in b:suggestBox. Second, define your dataSource like the one in the example.