cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with screen painter

Former Member
0 Kudos

Hi

I created a basic form in code, which has some folders on it. I then saved this in xml, reloaded the form in xlm, everthing was fine. I want to add lots of fields to the form so I started using screen painter.

The problem is now when I load the form from the new xlm file it only shows the buttons and no other fields or tabs.

I started from scratch again but as soon as I start using screen painter it seems to mess up the xml file.

Does anyone have any ideas please ?

Regards Andy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Why start in code, and then use screen painter...? You'd better start with screen painter, and finish the job in code...

Could you also provide the SBO version and patchlevel you're running...? In example, Screen Painter in SBO 2004 does crap up all datasources in your xml file, while Screen Painter in SBO 2005 nicely adds them for you...

Note: if you use tabs (folders) you need to bind the same datasource to all tabls, and link them to each other...

<b>Code (C#)</b>

// Get references to the folder
Folder fOne = SBOForms.Items.Item("UIDFldr1");
Folder fTwo = SBOForms.Items.Item("UIDFldr2");

// Add the DataSource
SBOForm.DataSources.UserDataSources.Add("dsFldr", dt_SHORT_TEXT, 1);

// Link the Folders and bind the datasources
fTwo.LinkTo = "UIDFldr1";
fOne.DataBind.SetBound(true, "dsFldr", "");
fTwo.DataBind.SetBound(true, "dsFldr", "");

Note #2: When using tabs, you need to ctach the et_ITEM_PRESSED events on the tab/folder items, and set the according panelevels. Remember: Pane 0 is always visible.

Former Member
0 Kudos

Hi

I started with code as I seemed to have problems with folders in screen painter. I am using sbo 2004 patch 24.

The customer will be using 2004, but if I design the xlm file in 2005 will that work ok in 2004 ?

Many thanks for your help

Regards Andy

Former Member
0 Kudos

I guess (don't tested it), because as far as I could see, the syntax is simular, and the 2005 screenpainter has the same functionality as the 2004 one (It des not even have the new objects, like a grid in it... )

Below I've posted a srf file, that you can load directly in SBO, with a "OK" button, two folders, and rectangle (for the folders)

The folder items you add in Screen painter are just the tab/folder 'buttons'. The rectangle is the white line that identifies the complete folder/tab (see also this screenshot: http://zooi.ookvan.mine.nu/folders.JPG)


<?xml version="1.0" encoding="UTF-16"?>
<Application>
   <forms>
      <action type="add">
         <form AutoManaged="0" BorderStyle="0" FormType="2000060006" ObjectType="" SupportedModes="0" appformnumber="2000060006" client_height="332" client_width="500" color="0" default_button="btnRefresh" height="359" left="453" pane="1" title="Rapport artikelen per locatie " top="201" type="0" uid="BTWO_DYNAMIC_UID" visible="1" width="508">
            <datasources>
               <dbdatasources>
                  <action type="add"/>
               </dbdatasources>
               <userdatasources>
                  <action type="add">
                     <datasource size="2" type="1" uid="dsFldr"/>
                  </action>
               </userdatasources>
            </datasources>
            <Menus/>
            <items>
               <action type="add">
                  <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="19" left="7" linkto="" right_just="0" supp_zeros="0" tab_order="0" text_style="0" to_pane="0" top="306" type="4" uid="1" visible="1" width="65">
                     <AutoManagedAttribute/>
                     <specific caption="Ok"/>
                  </item>
                  <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="237" left="9" linkto="" right_just="0" supp_zeros="0" tab_order="0" text_style="0" to_pane="0" top="64" type="100" uid="2" visible="1" width="483">
                     <AutoManagedAttribute/>
                     <specific/>
                  </item>
                  <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="19" left="10" linkto="" right_just="0" supp_zeros="0" tab_order="0" text_style="0" to_pane="0" top="46" type="99" uid="fOne" visible="1" width="74">
                     <AutoManagedAttribute/>
                     <specific AffectsFormMode="1" caption="Folder One" val_off="" val_on="1">
                        <databind alias="dsFldr" databound="1" table=""/>
                     </specific>
                  </item>
                  <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="18" left="84" linkto="" right_just="0" supp_zeros="0" tab_order="0" text_style="0" to_pane="0" top="46" type="99" uid="fTwo" visible="1" width="86">
                     <AutoManagedAttribute/>
                     <specific AffectsFormMode="1" caption="Folder 2" val_off="" val_on="2">
                        <databind alias="dsFldr" databound="1" table=""/>
                     </specific>
                  </item>
               </action>
            </items>
            <items>
               <action type="group">
                  <item uid="fOne"/>
                  <item uid="fTwo"/>
               </action>
            </items>
            <DataBrowser/>
         </form>
      </action>
   </forms>
</Application>

Note that if you save this xml as a srf, adjust it in screen painter and saves it again, screen painter has deprecated the <datasources></datasources> tags. So you should add them again... (by notepad or so)

You now only have to add the logica that catches the item_pressed events and sets the panelevels...

Good luck! I'm back on monday: for now weekend....

Grtz, Rowdy

Former Member
0 Kudos

Hi Rowdy

Just tried your file from 2005 and it works fine. I just need to get hold of a copy of it, as my evaluation copy won't load any addons.

Thanks for all your help

Regards Andy

Former Member
0 Kudos

Nice, glad to help...

If your question is answered, you can mark this topic as answered...

Greetz, Rowdy

Answers (0)