Caller Method from parent page from a nested user control - vb.net

I have been looking thru the many posts on calling a method on the parent page from the user control. However my user control is nested inside another user control which is on the parent page. How can i call the method from the parent page from with in this nested control?

All web controls inherit the WebControl which has a property called Page that can be used to the get a reference to the control's page.
As such you can simply use:
Dim ParentPage as Page = MyUserControl.Page

Related

Launching DocList Webtop Component within a Container

Are there any Documentum Webtop developers on here that know how to launch the DocList component within a simple container such as dialogcontainer ? I'm trying to implement some custom functionality for one of the screens in my Webtop-based application so that when the user clicks on the link for a folder, the DocList component is invoked to display the contents, then after the user is done looking at them, she can click the OK button provided by the container to return to the previous screen...
I've tried a couple different ways to do this. My first attempt was to use a dmf:link tag to call a new component I defined called doclistcontainer to contain the doclist component. My second attempt was to use a dmf:actionlink tag that called an action I defined which executes doclist within a container. In both cases, I end up with a blank screen, generic title, the OK button doesn't do anything... When I run a debugger on the code, I can see that the DocList behavioural class is being called despite the blank screen being displayed. What am I doing wrong?
Sheldon

Why is WinJS.UI.processAll() called automatically for you in Page Controls but not elsewhere?

The MSDN Documentation explains when to call WinJS.UI.processAll() yourself in your apps and when it's done for you automatically:
If you aren't using the Blank Application template or if you're adding
the control to a page that you created yourself, you might need to add
a call to WinJS.UI.processAll.
If you added the control to your app's home page (which is usually the default.html file), add a call to WinJS.UI.processAll in your onactivated event handler, as shown in the previous example.
If you added the control to a Page control, you don't need to add a call to WinJS.UI.processAll because the Page control does that for you automatically.
If you added the control to another page that is not your app's home page, handle the DOMContentLoaded event and use the handler to call WinJS.UI.processAll.
What's the reasoning behind the system calling WinJS.UI.processAll() automatically for you inside Page Controls, but not elsewhere?
It's also because the Navigation template (and the Grid template which is derives from the Navigation template) includes at least one data-win-control element so it needs to be processed to function.
We (Microsoft) don't want to put too much in the blank project template because after all it is "blank". So the blank project template just gives you the single page, no navigation, no controls, and thus no need for any processing. You can decide to add that on your own.

Webform within Access Form

I am trying to incorporate a html menu within access form. How would I get the feedback (on what the user selected within the web page) from the webpage into Access. I am using Access 2007, MS WebBrowser component.
any help would be appreciated
There is no official way to call the hosting form or initiate any activity on Access from within the WebBrowser.
However, there is one nifty trick which I use. After the document is loaded you can setAttribute of some element to the Access form. htmlDoc.all.formDiv.setAttribute "outerForm", Me
Then you can reference properties and methods of the form from within the WebBrowser.
document.all.formDiv.outerForm.Application.DoCmd.Close(2,"webForm")
EDIT:
Oddly, it seems that the reference remains null when as I add the <META http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> tag. Seemingly, the properties are more strict now, and setAttribute is expecting a string.
The next option is to pass the Access Form ('Me') to a variable in the WebBrowser. However it doesn't look like the global variables or functions are directly exposed.
This, though, can easily be overcome by adding a function to the prototype of HTMLBodyElement which passes its argument to a global variable, and can return any class as well.
In the html page you'd have this:
var frm = null;
HTMLBodyElement.prototype.setForm = function(f){frm = f}
From Access simply pass the reference down: htmlDoc.document.body.setForm(Me).

Send data form modal window Sharepoint

i am developing an application over Sharepoint 2010, I am using ECMAScript Client Object Model, so from one applications page using SP.UI.ModalDialog.showModalDialog(options) I am openning another page. From this second page I want to send the information the user inserts back to the parent page. HOw can I do this?.
Thanks a lot for any comments !
You can pass callback function in options of the showModalDialog method. This callback function takes two parameters, a dialogResult and a returnValue of type object that can contains any data.
http://msdn.microsoft.com/en-us/library/ff410058.aspx
When you close your modal dialog with method commonModalDialogClose you can pass result and object parameters and use them in your callback function in the parent window.
http://msdn.microsoft.com/en-us/library/ff409682.aspx

How to query the data from content type without using content query webpart in SharePoint2010.How can i?

I want to query the data from content type without using content query webpart. How could I do this?
My scenario is, I have a page layout, from the page layout I have created a page that contains some site columns values. After clicking on the save button I need to update the field in the page library column. How can I query the data in item updating event of the Site Pages Library.
Any help would be appreciated.
The ItemUpdating event method is passed an SPItemEventProperties parameter named property. This object contains information about the item responsible for firing the event handler. You can access this by calling properties.ListItem[Fieldname] or properties.AfterProperties[fieldname].
Something to note. The value of the SPItemEventProperties.BeforeProperties and SPItemEventProperties.AfterProperties as well as the properties of the SPItemEventProperties.ListItem, varies depending on the Event you are overriding and the type of SP List (List or Document Library). This chart shows these relationships.