I have a fairly complex Custom Control that may be used multiple times on any given XPage. In the control I create a couple of viewScope variables that have to be unique to the specific custom Control. I would like to do something like viewScope.put(customControlID + "variableName","Stuff) But I don't know how to get the custom controls ID
相关问题
- Unresponsive buttons after certain time
- Xamarin Custom View Button Binding
- Xpages “filter by category name” with two fields v
- How do I create a subclass of TabPage that I can e
- Logout control not working
相关文章
- How to get instance of Panel that holds content of
- viewForHeaderInSection creating a memory leak?
- call partialRefreshGet from SSJS using view.PostSc
- Bootstrap4XPages plugin: how to catch a change eve
- How to add html stored in a richtext item to an HT
- Remove Dojo from XPages globally
- Set ClientRectangle in custom form in C#
- Radio Button not firing itemcommand event in repea
You can get the current custom control ID with
this.getId()
at the<xp:view>
level.If you put this ID into a compositeData variable (e.g.
compositeData.id
) then you can use the ID inside the custom control everywhere you want.Usage in SSJS:
Typically, IDs are named like "_id2", "_id8", ...
Here is another solution as an SSJS function:
The function climbs the component tree until it finds the parent CC and then returns the id.
You can use it f.e. in a label like this:
You can use a dataContext variable:
The variable is then accessible as id in SSJS...
... or in EL: