cancel
Showing results for 
Search instead for 
Did you mean: 

Error Catching PDK.NET Events between two Visual Studio solutions

Former Member
0 Kudos

I have two Visual Studio PDK.NET 2.5 solutions. I am trying to integrate these products. Both are Visual Studio 2005. One is C# and the other VB.NET. Within each solution, I can Raise and Catch PDK events between iViews on the same SAP Page. However, if I put an iView from each solution on the same SAP Page, I cannot catch an event from an iView that belongs to another solution.

The method that I am using to Raise and Catch events is to define Producer and Consumer Event attributes on the iView classes. I am using this method as opposed to delegates.

Is it possible to raise and catch events between iViews that belong to different solutions?

Is it possble to raise and catch events between iViews that are written in a different .NET language (VB vs. C#)?

I can provide code snippets as needed.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

rima-sirich
Advisor
Advisor
0 Kudos

Hi,

As far as I know, the answer to your both questions is yes, it is possible and it should work. I would very appreciate if you could send both solutions to my mail. I would like to run it in my landscape.

Regards,

Rima.

Former Member
0 Kudos

Rima,

I have sent you smaller applications demonstrating what it is I am trying to do. These smaller applications are what I went to when I started having trouble in an effort to isolate what was going on. For sake of completeness in this forum, I have included my description from email of what the projects do in italics.

PortalApplication2 (C#) is sending an event to PortalApplication3 (VB.NET). Both only contain one iView/PortalComponent. I deploy them, then put the iViews on the same SAP Page. When I click the button from PortalApplication2, I should see “Hello World” in the label of PortalApplication3.

Thanks,

Lee

rima-sirich
Advisor
Advisor
0 Kudos

Hi Lee,

Could you please tell me how did you create the page in both scenarios ? Did you use PDK for .NET design-time component to create a page and define events between iViews ? Or did you create a page using Portal wizard ?

Thanks,

Rima.

Former Member
0 Kudos

Rima,

I created the page in the Portal, not the PDK. As far as I know, one cannot add iViews from two solutions in Visual Studio. The projects would have to be part of the same solution. So, the only way to do it is the Portal.

I did define the events at the class level for both iViews. You should be able to see that as class attributes on the iViews in the sample code I sent.

Thanks,

Lee

rima-sirich
Advisor
Advisor
0 Kudos

Hi Lee,

If you'll check the properties of the iView that succeeds to consume events ( navigate to iView property editor, filter the properties by .NET info ), you'll see that it's property com.sap.portal.dotnet.consumingEvents has value. In iView that doesn't succeed to consume events, this property is empty. This property gets it's value when you create a content using PDK for .NET design-time component. Therefore, this value is empty in iViews that were created using the Portal. This explains why you didn't succeed to consume events between iViews from different VS solutions.

Regards,

Rima.

Former Member
0 Kudos

Rima,

We tried "True", "Yes", and "-1" for values of com.sap.portal.dotnet.consumingEvents

None of these worked. Is there some other value that you had in mind to try?

Thanks,

Lee

rima-sirich
Advisor
Advisor
0 Kudos

Hi Lee,

Actually, it's value is a little bit more complicated. It is a string that contains object ID of the iView that raised the event, the name of the raised event and the name of the consumed event. It should look like "5840-6485-1258-4523, ClickEvent, ClickEvent".

Did you try to implement events by using client-side events mechanism ? There is a sample for using it in the [Online documentation|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/95628888-0d01-0010-7d97-f0d771999d0f], How to ... -> Portal Client-side events.

Regards,

Rima.

Former Member
0 Kudos

Rima,

Unfortunately, the events must be server-side, or the client-side event would have to trigger a post-back. It appears that [this documentation|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/95628888-0d01-0010-7d97-f0d771999d0f] shows how to cause a post-back from a client-side event. Do you think this is a viable work around to our problem?

Thanks,

Lee

Former Member
0 Kudos

Rima,

We are having problems with getting a value for the ObjectID for the consumingEvents property.

The ObjectID for an iView is something like iView1 instead of 5840-6485-1258-4523. There is a com.sap.portal.dotnet.UniqueId property, but it is blank and disabled.

Is there some secret to getting that value populated? Perhaps we are not adding objects to the portal in a way to get this property set? The method being used to add objects to the portal is by uploading the PAR file directly.

We did try using the full text objectid including namespace, but that proved unsuccessful.

Thanks,

Lee

rima-sirich
Advisor
Advisor
0 Kudos

Hi Lee,

iView unique id is determined by the com.sap.portal.dotnet.UniqueId value. By default, it's value is empty. You probably saw that this property belongs to category ".NET info". Portal is not familiar with this property. This property gets its value when iView is located on the Page in Visual Studio .NET and project is published to the Portal. You can see content published by Visual Studio .NET in Portal Content -> Content Created with PDK for .NET folder.

Regards,

Rima.

Former Member
0 Kudos

Hi Rima,

I am working with Lee Daniel in this problem.

I installed the MapPoint Solution in order to determine what the .NET info parameters look like. I don't know if you are familiar with this sample provided by SAP.

I published the solution from VS 2005 and I see 5 iviews created under the folder : "Content Created with PDK for .NET". There are duplicates for each iView for instance, there is a CustomerFind and there is MapPoint_CustomerFind that point to the same ascx file.

The CustomerFind raises the "AddressSelected" event and the FindNearby consumes it, therefore the consumingEvents for MapPoint_FindNearby has a value in the consumingEvents parameter such as "8dd23....89?AddressSelected,OnAddressSelected". This makes sense. The "8dd23...89" is the unique ID for the MapPoint_CustomerEvent (the produceer).

We are still stuck, because we deliver a par file, we can not allow the customer to publish the par file from VS2005.

I tried to create an iView from the Portal but it didn't have the .NET parameters, I could not find a template to use.

So, the question remains, how do we populate the UniqueId on the IView? Is this possible? I search the web and I can find any htis on the subject.

We really appreciate your help on this.

Thanks,

Melania Stewart

rima-sirich
Advisor
Advisor
0 Kudos

Hi Melania,

Unfortunately, editing server side events data is PDK for .NET feature, therefore it could not be used outside Visual Studio.

I understand that your customer can not use Visual Studio to publish content. On my opinion, there is a way to workaround this problem. You can publish the content from Visual Studio to your local Portal and use Portal export\import mechanism to transfer content from one Portal to another. Instead of the par file, give to your customer epa file.

Regards,

Rima.

Former Member
0 Kudos

Hi Rima,

Thanks so much. I'll try this.

One more thing... Can you please clarify to us, that when you export an iView you always get the content as well as the configuration? We have been delivering the par and the epa file. It seems as we have not need to deliver the par file. Is this true?

Lee and I have searched for answers to these questions for months now and you have given us so much information.

We really appreciate it.

Melania

rima-sirich
Advisor
Advisor
0 Kudos

Hi Melania,

You are welcome.

As far as I know, when you are exporting Portal objects ( iViews, Pages, etc ), the epa file includes all the configuration information and the par file as well. So you don't need to deliver the par file separately.

You can try the whole scenario:

1. Publish from Visual Studio to your local Portal

2. Export to epa file

3. Import from epa file

using the MapPoint application you mentioned in your previous post.

Regards,

Rima.

Former Member
0 Kudos

Rima,

Thanks for your time over these several months. After all your suggestions, Melania and I were able to cobble together a workable solution. One of the keys was to use the Raise() function and not use delegates in the C# project. Another key was to follow the strict design patterns in the documentation for consuming events. Lastly, the syntax for manually adding events to the .NET properties of iViews was needed. Especially, the syntax when there are multiple events. This syntax is not documented anywhere that we have found.

Thanks,

Lee

Answers (0)