You won't see the handler in your replacing page, however, you can still override it. For example, if the base page has a request called this:
{
request:"usr.MyCustomRequest",
handler: async (request, next)=>{// code is herereturn request?.handle(next);}}
In your code in the replacing page, you could add:
{
request:"usr.MyCustomRequest",
handler: async (request, next)=>{// YOUR code here, as needed// the line below calls the base page's handlerreturn request?.handle(next);}}
If you don't want the base page's handler to run, just omit the line below in your code:
return request?.handle(next);
Then with that line gone in your handler in the replacing page, the base page's handler won't run at all since it won't get called. If you still want it to run, but then your code does other stuff after it is done, you could do this:
{
request:"usr.MyCustomRequest",
handler: async (request, next)=>{// let base page handler run firstconst result = await request?.handle(next);// now do your stuffreturn result;}}
In order to customize a page from a marketplace add-on and override a custom handler in your custom package you can do the following:
Create a new client schema in your custom package (e.g., CustomPageSchema).
Extend the existing schema and override the handler:
define("CustomPageSchema", ["OriginalPageSchema"], function(){return{
entitySchemaName:"YourEntitySchemaName",
attributes:{},
diff:[],
methods:{// Override the custom handler
onButtonClick: function(){// Your custom logic here
console.log("Custom handler logic");// Optionally, call the base method if neededthis.callParent(arguments);}}};});
Register the custom schema in the CustomPageSchema schema.
After that deploy your changes and test.
Also if you don't want to create a new schema you can try to update the existing one.
1. Add new handler method in the method section:
methods:{
onButtonClick: function(){ }}
2.Bind the new method to "click" event of the corresponding button