0

I have a handle to the data source, that I know belongs to a document.

The document can be a new document.

I need to know the state: Is it new, open or edit?

Basically I wish to hide/show a button in a custom control, based on the state of the document this custom control is in. The custom control it self has other data sources, so I can't use currentDocument - because this will reflect the data source in the custom control.

If there's a simpler way to solve this problem I'm all ears!

Running on a Domino 8.5.3 FP3 server.

Hope this is clear.

Thanks!

/J

jBoive
  • 1,219
  • 1
  • 14
  • 40
  • 1
    a document itself can't be in read or edit mode. Your data sources can. So you check the document for isNewNote and the data source for read/edit. The approach with custom properties as Felix suggest is usual practice – stwissel Sep 13 '13 at 12:21

1 Answers1

1

you can realize this with property definition for the custom control

  1. add 2 property definitions to the custom control

    • Name = newmode
    • Type = boolean
    • Name = editmode
    • Type = boolean
  2. change the rendered property of the buttons

    if (compositeData.editmode==true) { false } else {true}

or

if (compositeData.newmode==true) { false } else {true}

  1. go to the XPages which has the custom control as member an map the status of the datasoucre to the customcontrol property definitions

enter image description here

I think the status open is always valid, just when the Xpages is open...

adminfd
  • 1,006
  • 7
  • 14