How to create and work on sub-region in APEX?

The one became collapsible sub 3 and this one we actually can’t see anything unless it has content so subregion 2 is here so if we associate my states item with sub-region to let me go find my states item I can actually do that here and actually I don’t want to duplicate it I just want to move it so let me just right-click and say move to sub-region two items now if I save and run you can see that’s still associated in sub-region too but I actually can’t see the container for sub-region two so in other words that can be a really nice way of sectioning related items on a form you make a sub-region container you put different items in it and then you make it so you just can’t see the container and let’s go ahead and do something like that because that’s going to be in the workshop.

So what I’m going to do is, I’m going to create a new page and if you want to follow along with me and you’ll just basically have the workshop done and if you already have an employee table an employee form I got a question in chat that said and would this be appropriate for displaying detailed data and absolutely so if basically if you’re trying to section off multiple pieces of information into related groups that’s when you’d want to use a sub-region and there’s also um organ the other example that we’re going to look at here is for organizing form data so I’m going to have two different groups of data on the same form I’ll show you what I mean so if you already have an employee form go ahead and navigate to that I’m going to create one very quickly so Marianne I believe us page 44 you so I’m just going to go ahead and create an employee form and report.

I’ll go ahead and create a new tab and I’ll just call it an employee yes I would like everything to be displayed actually I added an email column I’m going to get rid of that I like the yellow Edit pencil ok that’s a good question give me I’m going to loop back to that in one second the question was can I set the default of the of which Edit pencil to use which type of edit link to use we’re going to look at that so if you have a primary key in the table I always elect to use that I already have an existing trigger which is responsible for populating my primary key I want everything except email and I’m going to allow insert update delete that’s fine and then create okay so what we’re going to do here is we’re going to modify our form so that we kind of organize some of our form fields kind of in related groups, okay so I have my report but I don’t I’m going to run this page just so I can get to my employee details so I’m going to edit to king okay.

So now I’m editing king but what I’m going to do is I actually I want to relate three items together I want job salary and Commission to kind of be organized together okay so I could I could do that just by Ricci Qin Singh that’s one way or I could actually create some sub regions so that I kind of explicitly kind of keep these three items together it’s kind of a signal to all other developers like hey keep these things together ok so to do that and you’re going to have let me actually edit my page the correct page so to do that we need to add some sub regions to our page and it’s very easy we’re just going to go to the employee details region node and if we right-click we can say create sub region and it’s going to default to a static content type and I don’t believe we actually want to change its type I think everything that we want there is or yeah that’s all we want but what we do want to do is we want to change the template because we don’t actively want to see the title or or any of that stuff so we’re going to change the template we don’t want to use a standard item we’re going to use a blank region with attributes in other words you can’t actually see the region it doesn’t show up but it lets us it’s kind of a nice way to help position other components such as items and buttons and so we’re just going to call this the first region here we’re just going to call this amp info oops and then I’m actually going to go ahead and right-click this I’m going to say copy to amp info I’m sorry employee details sub-regions em info and I’m going to say column after so now I have em pin faux on the left and amp info on the right and all I need to do is I’m just going to change this to job info ok what does this do for me well let me go ahead and save my page and run notice that my page looks pretty much exactly the same it didn’t actually do anything yet.

But what I can do now is I can bucket my items into either one of those two fields and let’s see what happens now so what I’m going to do is, I’m going to grab the employee number I’m going to use hold down control I’m going to click a name ja a nut job manager hired eight and department number so all of these items I should be able to right-click orb sorry I can’t you can’t use the right-click menu but what you can do is over here on the right-hand side you can see that they’re part of the region employee IDs I want to put them all into the amp info region okay so they’ve all been shuttled into the amp info region the if you’re not seeing that go ahead and make sure that you align our you see all of the properties so make sure to click on show all and then underneath and layout we can change the region so if you have everything minimized you should see the layout and then you can change the region and if you should just pick whatever region is on the left sub region Oh got it.

So now what we can do is I’m going to grab a job a salary and Commission let’s just select all of those and we’re going to say you actually go in the job info then we go ahead and save and right okay so now we kind of have our items kind of sectioned out and we can control the position of kind of where we want these items to be so, in other words, remember apex likes to split things 5050 by default maybe that’s not what we want and it to see that I can actually click on show grid and I can see well here’s one section and here’s another section right you can see that this region is kind of split 50-50 well if I don’t want that I can say well I only want this region to span four columns so in other words, it’s only going to span four columns in its container region, so this is only going to take up four columns of the employee details let’s see what happens when we do that so I’m going to find em pin FO and I’m going to find its grid properties.

I do that by showing everything and I just minimize, that’s just how I like to use this and instead of column-span automatic I’m going to say to notice that now this job and this other job info kind of hugs more the job info.

Leave a Comment