Loading Browse File Based On User Input

Posted by Shaun Henderson on 06-Jul-2016 09:59

I am currently in the process of making changes to one of our programs. As part of these changes, we need to load a specific browse file based on a selection made in the viewer.

I've had some success with the code working as I would expect it to when running in our native environment. However, when I run the code within our environment that uses Consultingwerk's Winkit framework, I'm hitting a brick wall.

When a selection is made, the object assigned to the relevant handle is destroyed, a new object is initialized and the smartlinks are recreated. However, the overlayed browse from the Winkit Framework doesn't update to reflect this. I'm not sure how to destroy and subsequently reinitialize the overlayed browse from the Winkit Framework.

Any advice on switching browse files based on a user selection will be more than welcome.

Thanks.

All Replies

Posted by Mike Fechner on 06-Jul-2016 10:06

On which version of the WinKit are you? A lot of what you ask for may be very specific to your WinKit implementation. So it might be better if we look into that together online.

You will first have to receive the reference to the UltraGrid (RenderedBrowseControl) instance of the Browse and then remove it from it's container.

DEFINE VARIABLE oGrid AS Consultingwerk.WindowIntegrationKit.Controls.WinKitControls:FromBrowseHandle (BROWSE {&BROWSE-NAME}:HANLDE) /* or whatever is your browse handle */ .

oGrid:Parent:Controls:Remove (oGrid) .

DELETE OBJECT oGrid.

Then you'll have to create a new Grid, pretty much the same way as in your specific implementation the first grid was created:

help.consultingwerkcloud.com/.../Consultingwerk.WindowIntegrationKit.Controls.RenderedBrowseControl.html and

help.consultingwerkcloud.com/.../Consultingwerk.WindowIntegrationKit.Controls.RenderedBrowseContext.html

may help. For a better suggestion, I'd need to see your code.

This thread is closed