Add Buttons and Handlers to an Extension App
Prerequisites
Build an Extension App with App ViewsAdd Buttons and Handler
import * as ADK from "@symphony-ui/adk";
ADK.start({ id: "adk-example" }).then(() => {
ADK.buttons.add("Click Me", "hashtag", (payload) => {
console.log(`You clicked on a hashtag button`, payload);
// Perform actions
});
});Option 1: Use query parameters to pass context
import * as ADK from "@symphony-ui/adk";
ADK.start({ id: "adk-example" }).then(() => {
ADK.buttons.add("Click Me", "hashtag", (payload) => {
console.log(`You clicked on a hashtag button`, payload);
const params = "?context=" + encodeURIComponent(JSON.stringify(payload));
ADK.modules.open("view-a" + params, { title: "ADK View A" });
});
});Option 2: Expose Method on Controller
Last updated
Was this helpful?