Selwyn put together a series of videos to give you a basic overview of the custom component. They will explain what it is, how it can be called from a grid component, and how the values of the arguments defined in the custom component can be passed in from data in the current grid row -- all using XBasic of course!
The first video demonstrates how the component defines arguments whose value can be passed in from the calling program. After opening a new file, click on the new "custom component" icon, and the builder window will pop up to show you where to go to start building with your own XBasic code. In this case, Selwyn heads to the InitialRender function.
Once he gets there, our coding is already displayed and he is free to supplement it with his own, creating an argument. After you've created your argument, be sure to use it to replace the default XML. Once you've completed those steps, you'll be able to take your custom component and use it as a grid component.
The second video, picking up where we left off, starts right in with defining your grid. You'll have to insert a button into the grid in order to open your custom component, and immediately you'll be prompted to assign a value to that argument. Here, you'll get the chance to bind the value of the argument that you created for your custom component to a field in the current grid row.
Now, I know what you'll be thinking before you're thinking it: These first two videos were cool, but I haven't seen something I'd use often. Don't worry! Up next, our videos will demonstrate a more realistic example where the custom component is used to define a pie chart displaying the breakdown of items on an order.
For the demonstration in the second part of the second video, Selwyn will lead you to a component that he previously created, filled in with data from a sample database. Showcasing some more animation, he opens a pie chart using an action Java button that breaks down the sample data shown in his grid.
Selwyn will take a quick second to backtrack into design mode so that you can take a look at the button that opened Selwyn's custom component, and how the arguments bind values to their current row. In a closer look of Selwyn's component in edit mode, you'll see the exact line of XBasic coding that Selwyn used to create the pie chart.
The third and final video will finish up with a walk-through of the different functions within the XBasic function that were used to generate the components. This includes an in-depth look of the graphing functions used for the pie chart, the definition of the chart data, and more.
Phew -- that was a lot to cover! Just like our XBasic coders have been anticipating the ability to use their own code, we can't wait to see the apps that they come up with after creating their own custom components! Message to Alpha Five developers working in XBasic code: Click the videos below for inspiration!