Tags:
create new tag
, view all tags
-- JoaoCarreira - 22 Dec 2009

Menu Counter

The component xeo:MenuCounter allows adding counters to the TreePanel entires (think unread messages in outlook). This component extends the xvw:menu component.

Declaration
<xeo:menuCounter ... >
Properties
Property Values Description
id string Component Id
boql string / EL BOQL to give the count. Eg. select Ebo_Perf where active='1'
sql string / EL SQL to give the count. Eg: select count(*) from OEbo_Perf
counterValue string / EL Value to put in the counter, if the couter result is a bean property, or a fix value
counterMask string Value Presentation Mask: Eg: <b style='color:red'>%s</b> Where %s is replaced by the counter value.
updateInterval string Time in seconds between each update
Observations

The component to retrieve the counter value uses the following processing order:

  1. Checks if the counterValue has value.
  2. Checks if the boql property has a value.
  3. Checks if the sql property has a value
  4. Checks if the value has a JSON Object, and if it has the boql property.

Childs Elements

NO

Examples

Declaring a MenuCounter in a viewer:

<xvw:viewer (...)>
        <xvw:treePanel renderComponent='false' id='tree'>
    <xeo:menuCounter
         id='testCounter'
           boql="select MyObject"
           updateInterval='60'
      text='My Object'  
      value="{viewerName:'viewers/MyObject/list.xvw', boql:'select MyObject'}" 
      target='Tab' 
      serverAction="#{viewBean.listObject}"
    />
   </xvw:treePanel>
(...)

In the previous example as the property "counterValue" is not set, the value for the counter will be retrieved by counting the results of the boql expression.

How to update a counter programatically (in a Bean action):

 // Update a specific counter (using its client id)
 public void updateCounter() {
     MenuCounter.updateClientCounter( "formId:menuCounterId" );
 }

 //Update all counters
 public void updateAllCounter() {
     MenuCounter.updateClientCounters();
 }

Edit | Attach | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r10 - 2011-04-04 - NicolauGrosskopf
 

No permission to view TWiki.WebTopBar

This site is powered by the TWiki collaboration platform Powered by Perl

No permission to view TWiki.WebBottomBar