Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 11577

PB12.5.1 Build 4595: Behaviour of tab control in user objects

$
0
0

Hi,

 

I noticed that in PB 11.5.1 or earlier versions, the first tab in a user object was being selected by default when the tab control became visible.  There was no need to issue a SelectTab(1) command.  The selectionchanging event got fired and the oldindex got a value of -1 (since there was no previous tab) and the newindex got a value of 1 which is correct.

 

But in PB 12.5.1, although the selectedTab is set to 1 implicitly, it never goes through the selectionchanging event.  When the second tab is clicked, it goes through the selectionchanging event and oldindex is set to -1 and the newindex is set to 2.   The oldindex value of -1 is wrong in this case.  It should have been 1.

 

I found that the problem can be corrected by issuing a SelectTab(1) command forcing the code to execute the SelectionChanging event when the first tab became available for the first time.

 

This is the sample code that existed that was not working in PB 12.5.1

In this example, iu_cw is an instance of  the user object, u_prov_ent_cred_wizard, that holds the tab control

 

Existing Code: (The initial selectionchanging event does not occur in this case when the tab control and tab page become visible)

OpenUserObject(iu_cw, 'u_prov_ent_cred_wizard', 46, 756)

Messagebox("selected tab",string(iu_cw.tab_1.SelectedTab))  // SelectedTab is displayed as 1.  This was added for debugging

iu_cw.bringtotop = TRUE

 

New code that fixes the issue: (The initial selectionchanging event occurs in this code because of the explicit selecttab(1) statement)

    OpenUserObject(iu_cw, 'u_prov_ent_cred_wizard', 46, 756)

    Messagebox("selected tab",string(iu_cw.tab_1.SelectedTab))  // Still got back 1 as expected.

    iu_cw.tab_1.SelectTab(1)

    iu_cw.bringtotop = TRUE

 

The above code needed to be fixed since there was processing in the selectionChanging event based on the oldtab (oldindex) and the newtab (newindex).  The processing was failing because of the incorrect value of oldindex due to PB not executing the initial SelectionChanging event even though the first tab was visible and selected.

 

I am not sure if Sybase/SAP will consider this as a big enough problem to fix it and make it work the same way it did in earlier versions of Powerbuilder or if we will need to follow this workaround.

 

Thanks

Raj


Viewing all articles
Browse latest Browse all 11577

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>