Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a custom command, the default command

Status
Not open for further replies.

amnovice2

Programmer
Aug 11, 2003
13
US
hello,
I have a new node command for a custom node. Say the name of command is "Custom".
What should i do to make it default action for that node type? In other words, this "Custom" command should be executed when the user clicks on the node. I tried achiving this by modifying the 1 setup script
as follows.

.fCmdNames = { { "Open", "Custom" }, { "Attributes" }, { "Copy" }, { "CreateAlias" },
...... and so on.

But on doing this, the node becomes unclickable.
What more needs to be done?
I have written the WebNodeAction and WebNodeCmd for "Custom".

regards,
 
I think you have not completely overridden the command object.The preferred way would be to create a webnodeaction object and a webnodecmd object to call this newly created action object.This command will still apper in your function menu this way and will go to wherevr your FQueryString is set..The 'Open' is a command that is available in the Action-<blah> like Action-Create object so it will behave kind of weird.See if you can follow this course otherwise you will have to trace the call that the Action-<blah> does and figure it out.


This is from the documentation---
Code:
 If you create an WebNodeAction object for an existing command, it overrides the Action-command() method.

 
Hi appnair,
Thanks for replying.

As you have suggested, i already have created a webnodeaction object and a webnodecmd object. I have written the functionality for it and the command name appears in the functions menu as desired. The execution is also perfect.
My question is how can i make this command execute when the user clicks on the node? By default, when the user clicks on a node, the action performed is &quot;Browse&quot;. but i want that my custom action is performed when the user clicks on the node. At the same time, i do not want to override any existing functionality, not even Browse. i.e. the Browse functionality should be available from functions menu.
regards,
 
OK I think I have found it.This is what you will have to do.I basically have reproduced the behaviour that you are asking for by changing these lines.I am assuming that you are following the addressbook module building routine which I used to test this out.Since the browseview.html file is the one that needs to be changed and since it is a big file pls publish your email and I will send it to you.The file has the comments that will help you out

But this is the clue
when the object[red] ;open = webNode.Cmd( &quot;open&quot; ) [/red]is being called by OScript it is looking for its registered signature in the relevant OSpace.So if your custom node command has a webnode command called &quot;itemsinfo&quot;,from the addressbook example you can initiate a call to your node by
[red];showAV2= webNode.Cmd(&quot;itemsinfo&quot;)[/red]

The rest is just a conditional loop which I did to apply the new command to only the nodes I am interested similar to the lines of doing a conditional deal for doc.view vs doc.fetch.that actually helped me out.I will appreciate if you know this solution works and then probably I will put this out as a FAQ.I really think the attribute/forms question is really not my expertise and you shpuld probably post that out in KB itself.

Once again I am on 9.1.0.SP2 with Fetch enabled in the opentext.ini.
 
Hi appnair,
Sorry for the delayed reply. i was out of office for some days.

Please send the modified browseview.html to
&quot;livelink91@yahoo.com&quot;

thanks in advance,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top