Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Help with NVO

we have 3 datawindows (dataobject )which has to be polluted by selecting from different table.
Currently we have 4 function which do the processing and i am passing this 3 dataobject to each of this function, i need to use NVO, can you provide sample code so that i can pass this dataobject to NVO and included this 4 function in it and use it as instance object (without passing dataobject as argument)
0
rajinfosys
Asked:
rajinfosys
  • 3
  • 2
1 Solution
 
diasroshanCommented:
Hi,

What you have mentioned above sounds more like a solution than a question :)
For sure you are not a beginner to PB.

I suggest,
Create an NVO, create the functions in it, pass your DWs as datastore type arguments to the function or you can declare a datastore as an instance variable and use it all over the NVO.

I suggest you create how much you understand and then export the NVO and paste it here.

Then we can take you forward from where you are stuck.

Cheers,
Rosh
0
 
rajinfosysAuthor Commented:
i have 3 public function and 4 private function for processing,
we have several windows from which we call this NVO, we have created dataobject on this windows and have partially initialize it with window functions and now need to initialize it with balance column via NVO, please help me pass this dataobject and variable as instance to NVO

can i do it with constructor event available in window or any other event or method ?
please find attached screenshot of NVO for your reference

 private NVO function public NVO function public NVO function public NVO function
0
 
diasroshanCommented:
Hi,

There are various ways to do it... unfortunately i dont know ur exact scenario/requirement to give the most effective solution...

But from what i understood, instead of NVO, create a Custom Visual User Object.

Say you create a visual user object called uo_1
Now on this uo_1 you can have your datawindows dw_1, dw_2, dw_3 with respective dataobjects.
And create your functions on this uo_1, but no need to pass datawindow as argument to these functions.

Next, on your window, insert this newly create visual user object, Insert --> Control --> UserObject

Once uo_1 is inserted on ur window, make it invisible, so it behaves like NVO.

Now say u have 3 datawindows on your window which u partially populate and want to use them in the function(dw_a, dw_b, dw_c)

In the open event of the window, you can do a sharedatawindow between the DWs on ur window and DWs on uo_1

dw_a.ShareData(uo_1.dw_1)
dw_b.ShareData(uo_1.dw_2)
dw_c.ShareData(uo_1.dw_3)

So now, whenever u populate either DWs(window or UO) it will be shared.

When u do a dw_a.Update(), the values that you populated at uo_1.dw_1 will get updated as well.

I guess thats the solution your looking for.

Needless to say, you can still pay around with the above mentioned idea.

Cheers,
Rosh
0
 
diasroshanCommented:
Hi,

And please change the zone to powerbuilder.

In case you accept my solution, ill get points added to my PB zone :)

Cheers,
Rosh
0
 
rajinfosysAuthor Commented:
your solution is near to my problem, i want to accept it but don't know how to change zone
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now