0

Ho to all, I have a little problem..my code work very well..if I have my event handler into a XPages

`<xp:eventHandler event="autoSaveEvent" id="autoSaveDoc"
    submit="false">
    <xp:this.action>
        <xp:saveDocument>
        </xp:saveDocument>
    </xp:this.action>
</xp:eventHandler>`

but If I insert this into a Custom Control...the executeonserver don't work... I have read from here stack overflow post but for work I need to capture the id of my Custom Control..someone have any suggest?

Community
  • 1
  • 1
Daniele Grillo
  • 1,011
  • 4
  • 13
  • 31

2 Answers2

1

If you want to get the customcontrol you could probably do something like this. where abc is the name of a top level component in the custom control.

var ccId = '#{javascript:getComponent('abc').getParent().getId()}';

Fredrik Norling
  • 3,461
  • 17
  • 21
0

Tnx you @Fredrik Norling this is very good suggest!

this code below code work in every tree of child of where you insert the CC:

var eventId="#{javascript:getClientId('autoSaveDoc')}"
var n=eventId.split("view:_id1:"); 
var ccId=n[1];
Daniele Grillo
  • 1,011
  • 4
  • 13
  • 31