cancel
Showing results for 
Search instead for 
Did you mean: 

System Form Folder

Former Member
0 Kudos
57

Hi,

I follow the SDK sample to add a folder in inventory transfer form. But, it does not show in the form. Anyone try that berfore?? I'm using the B12005A SP01 PL:12

Regards,

Kit

View Entire Topic
Former Member
0 Kudos

Hi Kit,

Could you post the code that you are using? Else we can't see what is wrong...

Kind regards,

Rowdy

Former Member
0 Kudos

Dear Rowdy,

Here is my code:


 '// add a new folder item to the form
oNewItem = oSTForm.Items.Add("Folder1", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oSTForm.Items.Item("10")
oNewItem.Top = oSTForm.Items.Item("10").Top + 50
oNewItem.Left = oItem.Left
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "Content"
oNewItem = oSTForm.Items.Add("Folder2", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oSTForm.Items.Item("10")
oNewItem.Top = oSTForm.Items.Item("10").Top + 50
oNewItem.Left = oItem.Left + oItem.Left + 200
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "Info"
oFolderItem.GroupWith("Folder1")

I tested the above code, the folders is shown. But, I can't click on it.

Regards,

Kit

Message was edited by:

Chun Kit Chan

Former Member
0 Kudos

Okey, I see your problem...

You have to add a datasource to your form, and bind it to your folder objects

' Add a userdatasource
oSTForm.DataSources.UserDataSources.Add("FolderDS", dt_SHORT_TEXT, 1)

'// add a new folder item to the form
oNewItem = oSTForm.Items.Add("Folder1", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oSTForm.Items.Item("10")
oNewItem.Top = oSTForm.Items.Item("10").Top + 50
oNewItem.Left = oItem.Left
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "Content"
oFolderItem.Databind.SetBound(True, "", "FolderDS)

oNewItem = oSTForm.Items.Add("Folder2", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oSTForm.Items.Item("10")
oNewItem.Top = oSTForm.Items.Item("10").Top + 50
oNewItem.Left = oItem.Left + oItem.Left + 200
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "Info"
oFolderItem.GroupWith("Folder1")
oFolderItem.Databind.SetBound(True, "", "FolderDS)

That should do the trick. Now they are working, but you have to manually change the panelevel when someone clicks the folder items.

For example:

- All items that needs to be shown on the content folder should have a pane-level from 1 to 1

- All items shown on the content folder should have a panelevel from 2 to 2

- The buttons and all items that need to be visible on both folders should have a panelevel of 0-0

- When someone clicks you should change the form panelevel to the correct panelevel, and only the items you want to be visible are...

Hope this helps,

Rowdy

And just a note; when placing code on the forum, please put your code between [ code ] tags (without the spaces). It markes up your code as code...