cancel
Showing results for 
Search instead for 
Did you mean: 

Using Folders (Tabs)

Former Member
0 Kudos

Hello all,

I am wondering if I have to manually handle clicks of folder object and set the form's PaneLevel property.

The Folder object has the Pane property. What is it for if not for setting the Form's PaneLevel according to the folder clicked?

I have created several folders, have bound them to the same user datasource, have grouped them using Folder.GroupWith(method), but still they do not work automatically.

Is this the correct behaviour?

Anton

Accepted Solutions (1)

Accepted Solutions (1)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Anton,

There is a sample that shows how to work with Folders that comes with the SAP Business One SDK as part of the samples. Please have a look at ...

..\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\11.SystemFormManipulation

Hope that helps,

Eddy

Answers (5)

Answers (5)

Former Member
0 Kudos

Believe me, I lost a bet over this. Had to buy my colleague a drink because of it. I'm not 100% sure of this - i never asked any admins or something like that.

However, you can try one simple thing. Stop the ScreenPainter addon and see if it still works after that . There's no logical explanation for folder clicks working just on some forms and in some cases.

Former Member
0 Kudos

This is just an illusion. What happens is this : you create the form in ScreenPainter and then you click Preview - > what happens here is that the ScreenPainter addon adds events for Folder click . When you exit the designer the events are not removed because the ScreenPainter addon is still on.

So, when you test your form in your addon, the events for click on Folders are still registered. That's why it sometimes work.

Former Member
0 Kudos

No, this is not an illusion. This worked in my programs, one just yesterday. The very reason I got to this thread that after my attempts I started googling for "folder pane level srf sap".

Adam

Former Member
0 Kudos

There is a Pane property. Just build a form in Screen Painter - you can set the Pane property. I don't know if this is valid for UI api, though .

former_member191896
Active Participant
0 Kudos

Hi Anton,

When user clicks on a certain tab, you need to capture the event and set the Form.PaneLevel property accordingly. (I don't beleive there is a Pane property on Folder object.)

For each item on the form, you should specify FromPane and ToPane properties according to which panes you want this item to be visible on. If both FromPane and ToPane are set to 0 for a given item, it will be visible on all panes.

Regards

Aravind

Former Member
0 Kudos

Aravind Gadagottu:

When user clicks on a certain tab, you need to capture the event and set the Form

Thanks for reassuring. That's what I am currentry doing.

I don't beleive there is a Pane property on Folder object.

But it is there in Screen Painter! I even thought of reading it form the .xml manually to make all the work with Folders automatical (depending only on the .srf file and a piece of generic code, applicable to all forms).

Edward Neveux: Thanks, that also confirms that I have to do it manually (or as I suppposed above).

Anton

Former Member
0 Kudos

Unless I am mistaking, what you are saying is what happens with Screen Painter.

The thing I noticed is that the Screen Painter adds a User DataSource for each folder ( all are named "FolderDS") and sets the pane levels. Maybe you can try this, to set one DS for each folder tab.

Former Member
0 Kudos

Tibi Ionel:

Maybe you can try this, to set one DS for each folder tab.

No, the DS should be the same. It allows to control the Panes easily. As for the Pane property, it doesn't exists in DIApi, only is ScreenPainter.

Anton

Former Member
0 Kudos

the Pane Property of folder is used to link all the child Item the folder will contain. Like if I create three folder with Pane set to 1,2,3. When I add a new item after that I have choice which tab it should be placeed in. For button if I set FromPan=1 , ToPan=1, the button will be available only on folder 1. and if I set it to 2,2 it will be in folder 2. 0 is used to place the new item in main window. Hope it may help you little

Former Member
0 Kudos

Ubaid Mughal:

the Pane Property of folder is used to link all the child Item the folder will contain.

That's what I thought it was until I had found that in practice it does not work this way. As have been mentioned above, when using Folders one has to handle ItemPress events on each Folder and then manually change the form's PaneLevel property according to Folder that has been pressed.

With this manual work involved, the Pane property is just useless. If it had worked as you described, then this manual setting of Form.PaneLevel wouldn't have been necessary.

I just don't see how SBO makes use of this property. Maybe it just a stab and will be really used in the future?

Anton

Former Member
0 Kudos

Just to mud the water a bit more I can confirm that there are some circumstances when the folder change works without coding. I created srfs a number of times when this worked, by specifying the "pane" folder property, then all of a sudden it stopped working and I had to put in the code of handling the item pressed event.

I've spent now a bit of time, as this just happened again, trying the figure the right combination, but I am positive that I haven't changed anything since yesterday, yet the automatic method is not working.

So, I think this is a bug, really, but with a workaround.

Cheers

Adam

Former Member
0 Kudos

Or... just thinking about it, you are saying that the screen painter addon (the built in part) is doing it...! I suppose that is possible, you are probably right. That is certainly a plausible explanation.

Thanks.

Adam