• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Response Document from Navigator

Hi.

I've come across this problem in the past, and again now.  I'm wondering if anyone has found a work-around.

I have a navigator that exists on the left side of my notes app.
Views open in the main area (to the left).

I have action hotspots on the navigator that do things such as open views, create new documents, etc.  However, I'd like to have an action hotspot that will allow the user to create a response to the selected document in a view.

The problem is: when a user clicks on the hotspot, focus is taken off of the view and placed on the hotspot.  This results in a "no document selected" error.

Has anyone come up with any work-arounds for this?

Your help is appreciated.


Cory
0
cLFlaVA
Asked:
cLFlaVA
  • 14
  • 11
  • 4
  • +1
1 Solution
 
p_parthaCommented:
I am little rusty on the client side, but why don't you have the button in the view itself, this way you can use unprocesseddocuments method to get what is selected

Partha
0
 
cLFlaVAAuthor Commented:
I do also have one in the view -

I just wanted to have it in the nav as well.
0
 
HemanthaKumarCommented:
You can achieve this by frames..

place the navigator and view in two frames..and in the action formula specify targetframe before running the action..

eg:
@SetTargetFrame( "VIEWFrame" )
@PostedCommand([Compose]; ""; "Response");

~Hemanth
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
cLFlaVAAuthor Commented:
Hemanth-

Thanks for your response.
Does this mean the newly created document will open only in the targeted frame, rather than in the entire window?
0
 
HemanthaKumarCommented:
not necessarily.. you can control how you want to show the new document in various ways.. use forms launch property to specify a blank frame.. or use settargetframe to usin_blank frame..
0
 
cLFlaVAAuthor Commented:
Hi Hemanth;

I tried your proposed solution, but I am getting the same error.

I create a frameset with two frames:

----------------------------------------
|             |                                 |
|    nav    |          content            |
|             |                                 |
|             |                                 |
|             |                                 |
|             |                                 |
----------------------------------------

Where an action hotspot in nav will create a main document fine, opening the new main document to cover the entire screen.
I then added an action hotspot in nav with the following code:

@SetTargetFrame("content");
@PostedCommand([Compose]; "frmSOW")

The same error occurs: no document is selected, etc.

0
 
Andrea ErcolinoCommented:
To create a response document you should use a link like this

     http://<<host>>/<<path to database>>/<<childform>>?OpenForm&ParentUNID=<<selectedUNID>>

where selectedUNID is the UNID of the selected document in the view in the content frame. You'll need a bit of interframe access for detecting which document is currently selected and which UNID it has
0
 
cLFlaVAAuthor Commented:
It doesn't seem like this would work in the Notes Client...
0
 
Andrea ErcolinoCommented:
I got it!!

1. Let your Navigator open without using frames
2. put the following code inside the click event of the hotspot area in the navigator
---
      Dim s As New NotesSession
      Dim db As NotesDatabase
      Set db = s.CurrentDatabase
      Dim c As NotesDocumentCollection
      Set c = db.UnprocessedDocuments
      
      Dim w As New NotesUIWorkspace
      Set wdb = w.CurrentDatabase
      Call wdb.OpenView( "<<your view already open on the right>>" )
      Dim wv As NotesUIView
      Set wv = w.CurrentView
      Call wv.SelectDocument( c.GetFirstDocument )
      Call w.ComposeDocument( "", "", "<<your response form>>" )
---
0
 
p_parthaCommented:
Raputa,
Are you sure it works?.. I don't think so

Partha
0
 
Andrea ErcolinoCommented:
I use to test before posting any code larger than a single line... and there was no exception here
0
 
HemanthaKumarCommented:
It just slipped out of my mind.....there is a drawback on using Navigators.. they keep the context on the hotspot and will never switch the context even with explicit settargetframe command..

Rather use outline , this will work well in this kind of context based situations

0
 
Andrea ErcolinoCommented:
cLFlaVA,
to be as clear as possible: I tried the code I gave above and it works!!

For completeness, in the previous code you should put the declaration of the wdb variable which I forgot:

Dim wdb as NotesUIDatabase
0
 
cLFlaVAAuthor Commented:
Will test in a few minutes - be back soon.
thanks for your ongoing help.
0
 
cLFlaVAAuthor Commented:
Nah, this didn't work.

I got object variable not set after numerous different attempts and iterations at the line:

Call wv.SelectDocument( c.GetFirstDocument )

It appears wv is never properly set.
0
 
Andrea ErcolinoCommented:
> I got object variable not set after numerous different attempts and iterations at the line:
sorry, I don't understand... do you always get the same error for each try or do you get one error after many tries?

0
 
cLFlaVAAuthor Commented:
I get the same error, each time.
0
 
cLFlaVAAuthor Commented:
Hemanth:

Outlines are something I've never worked with.  Any references or links you can point me to for a working example?
0
 
Andrea ErcolinoCommented:
Are you sure you wrote the name of the view as it is, without typos?
0
 
cLFlaVAAuthor Commented:
Why would I want to re-open a view?  I don't understand...  The views will never be static - depending on the view the user is looking at - so I can't just hard-code a view in there.  I tried using NotesUIWorkspace.CurrentView.Viewname but even before this: as soon as you set the NotesUIWorkspace, all of its contents are empty (not set).
0
 
Andrea ErcolinoCommented:
Well, the OpenView is needed for initializing the CurrentView property, so...
that is the reason why my code modified by you does not work
0
 
cLFlaVAAuthor Commented:
I had tried it your way as well.  The bottom line is I can't type in the name of a view there, as it has to be dynamic.
0
 
cLFlaVAAuthor Commented:
ps - it did work if i hard-coded the view.
0
 
cLFlaVAAuthor Commented:
however, if for whatever reason the user has checked off a few different documents, then highlights another one, and clicks "respond", the wrong document is responded to.
0
 
Andrea ErcolinoCommented:
Navigators are an old design element... they are functionally replaced by Outlines, so if you can use Outlines, go that way, it's fairly simple

> however, if for whatever reason...
of course, but you can put a check like <<If c.Count > 1 then Exit Sub>>
0
 
cLFlaVAAuthor Commented:
ok, any advice on outlines?  how do they work?

thanks...
0
 
Andrea ErcolinoCommented:
1. Create an Outline
2. Create a Page
3. Embed the Outline in the Page
4. Create a Frameset: Nav / Content
5. Load the Page in the Nav frame
6. Program the Outline actions and test
0
 
HemanthaKumarCommented:
Outlines are the designe element which is used as treestyle or flat style menu navigation.. open the designer you can find outlines listed.. create one and it is exactly like navigator hotspot buttons ... but are like displayed as treestyle instead of free-form.

You can specify to open view or any other design element...and also you can enter formula actions like compose . Save this outline and embed it in a page.. specify the page in the frame that opens when db opens...
0
 
Andrea ErcolinoCommented:
Anyway, if you want to use your old Navigator, you can use a <<CurrentView>> environment variable for having the name of the view dynamic:

1. in any view accessed by the Navigator, put this formula <<@Environment( "CurrentView"; @Subset( @ViewTitle; -1 ) )>> in the QueryOpen event
2. put the following code inside the click event of the hotspot area in the navigator
---
      Dim s As New NotesSession
      Dim db As NotesDatabase
      Set db = s.CurrentDatabase
      Dim c As NotesDocumentCollection
      Set c = db.UnprocessedDocuments
      If c.Count <> 1 Then Exit Sub
      
      Dim currentView As String
      currentView = s.GetEnvironmentString( "CurrentView" )
      
      Dim w As New NotesUIWorkspace
      Set wdb = w.CurrentDatabase
      Call wdb.OpenView( currentView )
      Dim wv As NotesUIView
      Set wv = w.CurrentView
      Call wv.SelectDocument( c.GetFirstDocument )
      Dim wd As NotesUIDocument
      Call w.ComposeDocument( "", "", "Child" )
---
0
 
cLFlaVAAuthor Commented:
Thanks for your help
:)
0
 
Andrea ErcolinoCommented:
don't mention it!
:-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 14
  • 11
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now