createchildcontrol() - user control, custom control, web control - user-controls

I am new to .Net trying to understand about different controls here. I know, custom control, an extension of existing control. User control, a complicated control constructed in .ascx file and can be used anywhere in the application. I couldn't the concept of createchildcontrol() and need of it.
thanks !

It plays the role in the lifecycle of a page request to ensure all controls generated dynamically/via code are in place for binding postback values and rendering out to the page. Also note from the MSDN page:
When you develop a composite or templated server control, you must
override this method.
You can check this page for the full list of events, in order, on an ASPX request.

Related

Azure AD B2C Password reset flow custom layout password validation not working properly

I've created a custom layout for the "Password reset" user flow.
The password entry validation does not work properly, it does not always detect entries and when it does the information it provides is incorrect.
My layout has no custom CSS or JavaScript, it is just a plain HTML document with the div containing the value api in the id attribute inside the body.
I worked around this issue. I extracted CSS from the default layout provided by Microsoft.
One or some of those CSS classes did the trick, although I am not sure which of those is necessary. I wasn't able to find any information on the custom layout documentation page and that's the actual issue I have.
Generally to avoid this issue, we recommend starting with the templates, and adding your customisation on top. The templates contain a lot of the JS/CSS to control the default controls and error messaging that is part of the page.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-ui-customization#customize-the-default-azure-ad-b2c-pages

Signature Capture on SO Invoice

We currently have a requirement where an end user can perform a signature capture inside the SO Invoice screen.
End user would click a button or execute an action from the Actions Menu. A touch screen graphical editor would come up allowing the user to use their finger or any hardware supported to create a signature image. Upon clicking Accept, the image would be stored against the document Files attachment.
We are looking for something possibly already developed, or if necessary, a control we might be able to spawn that could then write the image attachment back.
Please advise.
If I'm not mistaken, at this point the functionality to create user signatures and attach the signature image file to an Acumatica ERP form that supports file attachments is exclusively available only in Acumatica mobile applications. I wish there were an Aspx control inside the framework, which could be used as is for that purpose, but unfortunately, there is not any to my knowledge.
An alternative approach is to create a custom PXSmartPanel embedding a custom HTML webpage (via the InnerPageUrl property). The custom HTML page can be used only to capture the signature and attach it to the current record inside Acumatica.
Since RuslanDev noted the mobile application for this, I'll share the MSDL code from the new T400 class on Customization of the Mobile Application. I don't think this is what you were asking, but I'm adding as an answer to preserve formatting for those that may be looking for how to do this in Mobile.
To add to the mobile application on 2018 R2, use the new Mobile Applications section of the Customization Project. Simply add the - add recordAction "SignReport" - section as shown below.
update screen SO301000 {
update container "OrderSummary" {
add recordAction "SignReport" {
behavior = SignReport
displayName = "Sign"
}
}
}

Liferay, include one web content in another web content

Let's say I have web content, which is a modal dialog. Now I want to be able to reuse this content in several other web contents. What is the easiest way to achieve this without copy modal code to each web content? JavaScript is allowed.
Web content is a modal dialog? I don't understand the usecase, thus it's hard to give proper sample code.
If you're aware of the ID of the other webcontent that you want to use, you can retrieve this content through the API, e.g. by writing structures/templates. Templates are able to access the API and render other articles. Some of the API is hidden from templates by default, but you can revert this - look for "restricted" in portal.properties
The WCM API is named after its formal name "Journal*", check the API, e.g. JournalArticleService.

XPages Mobile Controls - how to program the Back button

The XPages Mobile Controls provide an easy way to mobilize Notes/Domino data. However, if you have say 3 different views that help point a user to a specific record, the "Back" button you add to your appPage that allows users to view/edit the document can only be pointed back to a specific appPage. What's the best way to create a programmable Back button taking into account the view that the user came in via.
The back button on a mobile page can be computed dynamically just like any other XPage property.
Try this for example where you can set the scope to a mobile page you've navigated from to the current mobile page.
<xp:this.moveTo>
<![CDATA[#{javascript:var from = sessionScope.get(“from”); return
from;
}]]>
</xp:this.moveTo>
This is the same technique that is used in the Discussion XL and TeamRoom XL templates for their mobile apps.
To set the scope use the rendered property in the heading control for each 'view' mobile page so every time these pages are loaded or swapped to the scoped variable is set. Try the following link to get the full demo markup from OpenNTF XSnippets
computed back button demo markup on XSnippets

UpdatePanel in SharePoint throws an error

I get the following when I click on a custom made webpart in the Web Part Gallery: The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it. If I use the webpart, ie perform a search, I get a pop-up error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The Status code returned from the server was: 500.
This webpart takes a search string from a textbox, passes it to BL/DAL and returns a data from DB. I've integrated an UpdatePanel for partial postbacks - used this blog as guide but it is not working.
I've added the scriptManager to the default.master page using MSSP Designer as the blog suggests but curiously, the script manager causes an error (red underline) In Internet Explorer 6.0 the tag <asp:ScriptManager> is not permitted.
I'm not totally sure what's up with that but here's an alternative. Dont use MS Ajax - EVER. jQuery is simpler, faster, better, stronger, sexier!
This is how I normally do this stuff:
add jQuery to your master page head
create a user control that implements your web part ui. This should use Page.ScriptManager.RegistryScriptInclude or .RegistryScriptBlock to insert script for the control. Eg, methods to do your callback using jQuery.Ajax.
create a web part wrapper for the user control
create an aspx in _layouts that acts as the 'service' for your callback. The page load can use the parameters passed from the ajax call to return some json or text
Instead of #4 you could create a web service but this is a lot harder with SharePoint - an apx will work well enough.
HTH
Cheers

Resources