Skip to Content
0
Former Member
Jun 27, 2006 at 09:11 AM

Event gets lost when iView is uncompressed for the first time

33 Views

Hi All,

we are developing an application that manages attachments (meaning: files stored in KM) and per request by the client consists of several iViews. One of them contains a search interface, another one lists the hits that have been found. So the iViews have to communicate.

We achieved the funcionality by using portal eventing and the HTTP session. The search iView compiles the search string and writes it to the session.

request.getComponentSession().getHttpSession().setAttribute(searchString, .....);

We then use javascript to fire an event on which the searchResult iView reacts and fetches the searchString from the session. The actual search is then performed within the searchResult-iView.

The only problem is that the client requested that the searchResult iView should initially be collapsed. So we set its "initial display" property to "collapsed" and implemented some javascript functionality in the search iView that expands the searchResult iView when a search is performed:

function openIview( iviewID ) {

var temp = parent.pageSupport._getIvuPageId(iviewID);

var ivuBankObj = parent.pageSupport._getIViewBank(temp);

if (ivuBankObj.getToogle() == 0) {

var trayid = ivuBankObj.getTrayId();

var event = document.createEventObject();

event.type = "click";

if(parent.htmlb_TrcToggle(trayid,'0',event)) parent.pageSupport.ivuToogle(iviewID);

};

};

We then fire an event:

EPCM.raiseEvent('...', 'SearchEvent', param, '');

All works fine, except for the very first time the searchRersult iView is expanded after the application (meaning the page containing the iViews) has been opened. The searchResult iView is properly expanded, but the event seems to get lost so that no search is being performed (no error, but no reaction by the iView).

We observed that it seems as if the contents of the iView are only fetched by the browser when it's expanded for the first time. (The progress bar of the browser shows loading activity when expanding the iView for the first time). Supposedly the event gets lost because the serachResult iView doesn't fetch it since it's just being loaded.

After this initial erroneous behavior, the iView can be in compressed or expanded state before a search is being performed and everything works fine.

Interestingly enough the problem can be resolved by setting a timeout of several seconds after expanding the iView and before firing the search event. But we find this to be a very questionable (and inconvenient) method of solving this problem and would rather like to solve it properly.

Does anyone have any ideas how we could achieve this? Is there a way to determine whether an iView has been loaded by the browser (because obviously displaying and loading an iView seem to be two different things)?

Thanks in advance,

Jens