[HELP][NOOB] Actions on tree nodes

2 posts / 0 new
Last post
Dealus
Offline
Joined: 08/23/2011
[HELP][NOOB] Actions on tree nodes

Hello,

i'm starting learning JSpresso, and after getting through the 10mn tutorial, i'm now trying to experience some stuffs with the UI.

I tried to manage some actions on a tree's nodes, but couldn't add a deleting functionality. I'm a bit confused with JSpresso's built in actions... Here is the  SJS code i'm using (based on tutorial).

//-------------------------------------------------

// Tree nodes definition

//-------------------------------------------------
    
treeNode 'Department-teams.treeNode',
    rendered:'ouId',
    actionMap:'masterDetailActionMap'

treeNode 'Department-employees.treeNode',
    rendered:'name',
    actionMap:'masterDetailActionMap'

treeNode 'Company-employees.treeNode',
    rendered:'name',
    actionMap:'masterDetailActionMap'

treeNode 'Company-departments.treeNode',
    rendered:'ouId',
    actionMap:'masterDetailActionMap'

treeNode 'Team-teamMembers.treeNode',
    rendered:'name',
    actionMap:'localActionMap'

//-------------------------------------------------

// Tree definition

//-------------------------------------------------
    

tree('Company.tree',
    rendered:'name',
    preferredWidth:200,
    preferredHeight:200,
    icon:'structure-48x48.png') {
      subTree('Company-employees.treeNode')
      subTree('Company-departments.treeNode')
      {
          subTree('Department-teams.treeNode')
          {
              subTree('Team-teamMembers.treeNode')
          }
      }
    }
    
//-------------------------------------------------

// Actions definition

//-------------------------------------------------
actionMap('localActionMap') {
    parentActionMaps:'masterDetailActionMap'
    actionList('EDIT_LOCAL') {
        action(parent:'lovAction',
            custom:[
              autoquery:true,
              entityDescriptor_ref:'Employee',
              initializationMapping:['company':'company'],
              okAction_ref:'addFromList'
            ]
            )
        action(ref:'removeFromList')
    }
}

action('removeFromList', parent:'removeEntityCollectionFromMasterFrontAction')

 

I just don't know what to use instead of the red action...
And i don't even know if selecting a node in the tree really does select the entity behind.

Thx in advance for any suggestion.

 

vvandens
Offline
Joined: 05/29/2008
[HELP][NOOB] Actions on tree nodes

Hi,

Welcome to the Jspresso forum! I've just fixed a bug that prevented the actions based on record selection (like remove, duplicate, copy) to activate correctly in pop-up menus. So your problem should be fixed on the latest 3.5-SNAPSHOT. As a complement, please note that the pop-up menus are only available in the swing UI as of now.

 

Regards,

Vincent