Does anyone use an xe: calendarView control for ExtLib? If so, how do events work?

I am trying to use the xe: calendarView control in a real world application. So far, I could read the data from the view and display it on the calendar, which was easy.

But now I want to open the recording with double or singleclick, or I want to change the recording date by dragging and dropping. For this, the control has events such as "onOpenEntry", where I can write SSJS. But I'm stuck here:

  • In this case, how can I get the UNID of the document for which the event was generated? "this" is a com.ibm.xsp.extlib.dwa.component.calendar.UICalendarView object. I found the source code for this class, but I do not see access to the document that should be open.

  • In addition, the onOpenEntry event is fired only once when the control is loaded. After that, it does not work when clicked or double-clicked.

It seems to me that these events are not fully implemented ... and they are not used in the ExtLib demo database either. Does anyone know how this works? Thanks!

+7
source share
2 answers

The xe: calendar control is based on the iNotes calendar view. As a result, events trigger only client-side JavaScript, not server-side JavaScript. Using syntax C # {javascript: ...}, you can pass evaluated SSJS, for example.

#{javascript:(userBean.accessLevel >= lotus.domino.ACL.LEVEL_AUTHOR) && userBean.canDeleteDocs} 

This will verify that the user has at least database access rights and deletion privileges. Similarly, you can use the following code to get the full URL of the current page to manipulate when creating a new URL to redirect to:

 var path = #{javascript:"\"" + @FullUrl('/') + "\""}; 

Keep in mind that server-side JavaScript will be evaluated when the function is written to XPage, and not when the button is clicked.

You can get unid using (as client-side Javascript, not server-side JavaScript) the elements [0] .unid.

See the calendar custom control in the Teamroom template that ships with Service Pack 1 or the extension library for more information.

+4
source

You can associate an event with a calendar entry using dojo or jquery. I found the code below for an entry containing unid.

So you should be able to do something like this

  • find id ... calendarView1-entry0
  • get unid attribute
  • Associate the id with the desired event and do a popup or something else.

     <div id="home:_id1:dynC:_id556:calendarView1-entry0" class="s-cv-entry" calendar_type="Meeting" unid="723C2A5387AA7994C12579B30056D07E" calendar_date="20120622" calendar_index="0" calendar_start="20120622T000000,00$Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe" calendar_end="20120622T010000,00$Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe" calendar_start_notes="20120621T220000Z" calendar_bgcolor1="#C1DDF9" calendar_bgcolor2="#5495D5" calendar_fontcolor="undefined" calendar_bordercolor="undefined" calendar_external="0" onmouseover="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" onmouseout="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" onclick="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" ondblclick="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" oncontextmenu="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" style="top: 0px; left: 504px; width: 114px; height: 48px; "><canvas id="home:_id1:dynC:_id556:calendarView1-entry0-gradient" class="s-cv-entry" style="top:0px;left:0px;width:100%;height:100%;" color2="#C1DDF9" color="#5495D5" width="114" height="48"></canvas><div tabindex="0" class="s-cv-entry-innerframe s-cv-entry-innerframe-height s-cv-text" unselectable="on" aria-describedby="home:_id1:dynC:_id556:calendarView1-entry0-target" aria-haspopup="true" role="menu" style="top:0px;left:0px;width:100%;color:undefined;white-space: nowrap;" com_ibm_dwa_ui_draggable_redirect="home:_id1:dynC:_id556:calendarView1"><img alt="Meeting" src="/xsp/.ibmxspres/.dwa/common/images/transparent.gif" width="13" height="11" style="border-width:0px;background-position: -0px -0px; background-image: url(/xsp/.ibmxspres/.dwa/common/images/colicon1.gif);">&nbsp;Midsommar<br>8clfux40</div> 
+2
source

All Articles