I'm using PB 2022 R2 Build 2828. I upgraded the PFC version correlate with PB 2022.
So I have a window with the inv_resize active. Everything is working perfect. The dw are resizing perfect the columns are resizing (construction event register every column with the correct %) Every is working perfect. We have 4 different data presentations, means we change the datawindow object thru a clicked event of a radio button.
Radio button clicked event:
//==================================
dw_7.dataobject = 'd_bid_product_list_group_1_data'
//CCH OPENING A CHANELL BETWEN DATABASE AND DATAWINDOW
dw_7.SetTransObject(sqlca)
inv_resize.of_UnRegister(tab_1.tabpage_2.tab_2.tabpage_12.dw_7)
dw_7.of_setresize(false)
inv_resize.of_Register(tab_1.tabpage_2.tab_2.tabpage_12.dw_7,0,0,100,70)
dw_7.triggerevent('constructor')
dw_7.retrieve(tab_1.tabpage_1.dw_1.OBJECT.bid_project_code[1])
IF dw_21.dataobject = 'd_bid_product_component_list_view_sumary' THEN
dw_21.retrieve(tab_1.tabpage_1.dw_1.OBJECT.bid_project_code[1],0)
ELSE
dw_21.retrieve(tab_1.tabpage_1.dw_1.OBJECT.bid_project_code[1],gstr_gen.compcode,0)
END IF
dw_7.TriggerEvent('resize')
//======================================
My issue is if I change the datawindow object with the window's size bigger than normal the columns do not resize according the size of the window, datawindow. The actual datawindow risizes with no issue but the columns do not.
Here the construction event of the datawindow. Depending which dataobject is I register the columns accordingly:
//==============================================================
//CCH OPENING A CHANELL BETWEN DATABASE AND DATAWINDOW
this.SetTransObject(sqlca)
// Start the Row Manager Service.
of_SetRowManager(true)
// Start the Row Selection Service.
of_SetRowSelect(true)
// Set the Row Selection Service to allow multiple
// record selection.
inv_rowselect.of_SetStyle(inv_rowselect.Extended)
//ACTIVATE THE SORT SERVICE FOR THE DATA WINDOW
OF_SETSORT(True)
THIS.INV_SORT.OF_SETSTYLE(1)
THIS.INV_SORT.OF_SETCOLUMNHEADER(TRUE)
//CCH DEACTIVATE THE RIGHT MOUSE BUTTOM PFC FUNCTIONALITY
ib_RMBmenu = FALSE
//CCH TELLING PROCESSING THIS DW IS NOT UPDATEABLE
//this.of_SetUpdateable(FALSE)
//CCH TURN ON RESIZE SERVICE
of_SetResize(true)
IF this.dataobject = 'd_bid_product_list_group_1_data' THEN //cch presentation product type
//// Args - PercentageX, PercentageY, PercentageWidth, PercentageHeight
inv_resize.of_Register('tbl_bid_products_line_number_t', 0, 0, 5, 0)
inv_resize.of_Register('tbl_bid_products_line_number', 0, 0, 5, 0)
inv_resize.of_Register('key1_t',5, 0,5, 0)
inv_resize.of_Register('key1', 5, 0, 5, 0)
inv_resize.of_register( 'c_bid_number',10,0,20,0)
inv_resize.of_Register('c_prod_name_t',10,0, 20, 0)
inv_resize.of_register("c_product_type",10,0,20,0)
inv_resize.of_Register('c_prod_name', 10, 0, 20, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size_t',30,0,15, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size', 30, 0, 15, 0)
inv_resize.of_Register('unit_mesur_t',45,0, 5, 0)
inv_resize.of_Register('unit_mesur', 45, 0, 5, 0)
inv_resize.of_Register('revise_qty_t',50,0, 5, 0)
inv_resize.of_Register('revise_qty', 50, 0, 5, 0)
inv_resize.of_register('c_revise_qty_sum',50,0,5,0)
inv_resize.of_Register('contract_qty_t',55,0, 5, 0)
inv_resize.of_Register('contract_qty', 55, 0, 5, 0)
inv_resize.of_register('c_contractqty_sum',55,0,5,0)
inv_resize.of_Register('ourcost_t',60,0, 5, 0)
inv_resize.of_Register('ourcost', 60, 0,5, 0)
inv_resize.of_Register('total_cost_per_unit_t',65,0, 10, 0)
inv_resize.of_Register('total_cost_per_unit', 65, 0, 10, 0)
inv_resize.of_register('c_total_cost_perunit_by_prodtype',65,0,10,0)
inv_resize.of_register('grand_total_cost',65,0,10,0)
inv_resize.of_Register('contract_price_t',75,0, 10, 0)
inv_resize.of_Register('contract_price', 75, 0, 10, 0)
inv_resize.of_Register('total_contract_price_t',85,0, 10, 0)
inv_resize.of_Register('total_contract_price', 85, 0, 10, 0)
inv_resize.of_register('c_total_per_productype_contractprice',85 ,0, 10, 0)
inv_resize.of_Register('grand_total_contract_price', 85, 0, 10, 0)
inv_resize.of_Register('tbl_bid_products_has_component_y_n',95,0, 5, 0)
ELSEIF this.dataobject = 'd_bid_product_list' THEN //cch presentation regular
//// Args - PercentageX, PercentageY, PercentageWidth, PercentageHeight
//
inv_resize.of_Register('tbl_bid_products_line_number_t', 0, 0, 5, 0)
inv_resize.of_Register('tbl_bid_products_line_number', 0, 0, 5, 0)
inv_resize.of_Register('key1_t',5, 0,5, 0)
inv_resize.of_Register('key1', 5, 0, 5, 0)
inv_resize.of_register( 'c_bid_number',10,0,20,0)
inv_resize.of_Register('c_prod_name_t',10,0, 20, 0)
inv_resize.of_Register('c_prod_name', 10, 0, 20, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size_t',30,0,15, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size', 30, 0, 15, 0)
inv_resize.of_Register('unit_mesur_t',45,0, 5, 0)
inv_resize.of_Register('unit_mesur', 45, 0, 5, 0)
inv_resize.of_Register('revise_qty_t',50,0, 5, 0)
inv_resize.of_Register('revise_qty', 50, 0, 5, 0)
inv_resize.of_Register('contract_qty_t',55,0, 5, 0)
inv_resize.of_Register('contract_qty', 55, 0, 5, 0)
inv_resize.of_Register('ourcost_t',60,0, 5, 0)
inv_resize.of_Register('ourcost', 60, 0,5, 0)
inv_resize.of_Register('total_cost_per_unit_t',65,0, 10, 0)
inv_resize.of_Register('total_cost_per_unit', 65, 0, 10, 0)
inv_resize.of_register('grand_total_cost',65,0,10,0)
inv_resize.of_Register('contract_price_t',75,0, 10, 0)
inv_resize.of_Register('contract_price', 75, 0, 10, 0)
inv_resize.of_Register('total_contract_price_t',85,0, 10, 0)
inv_resize.of_Register('total_contract_price', 85, 0, 10, 0)
inv_resize.of_Register('grand_total_contract_price', 85, 0, 10, 0)
inv_resize.of_Register('tbl_bid_products_has_component_y_n',95,0, 5, 0)
ELSEIF this.dataobject = 'd_bid_product_list_group_1_data_phase_order1' THEN
//// Args - PercentageX, PercentageY, PercentageWidth, PercentageHeight
//
inv_resize.of_Register('tbl_bid_products_line_number_t', 0, 0, 5, 0)
inv_resize.of_Register('tbl_bid_products_line_number', 0, 0, 5, 0)
inv_resize.of_Register('key1_t',5, 0,5, 0)
inv_resize.of_Register('key1', 5, 0, 5, 0)
inv_resize.of_register( 'c_bid_number',10,0,20,0)
inv_resize.of_Register('c_prod_name_t',10,0, 20, 0)
inv_resize.of_register('c_phase',10,0,20,0)
inv_resize.of_Register('c_prod_name', 10, 0, 20, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size_t',30,0,15, 0)
inv_resize.of_register("c_product_type",30,0,15,0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size', 30, 0, 15, 0)
inv_resize.of_Register('unit_mesur_t',45,0,10, 0)
inv_resize.of_Register('unit_mesur', 45, 0, 10, 0)
// inv_resize.of_Register('revise_qty_t',50,0, 5, 0)
// inv_resize.of_Register('revise_qty', 50, 0, 5, 0)
// inv_resize.of_register('c_revise_qty_sum',50,0,5,0)
inv_resize.of_Register('contract_qty_t',55,0, 5, 0)
inv_resize.of_Register('contract_qty', 55, 0, 5, 0)
inv_resize.of_register('c_contractqty_sum',55,0,5,0)
inv_resize.of_Register('ourcost_t',60,0, 5, 0)
inv_resize.of_Register('ourcost', 60, 0,5, 0)
inv_resize.of_Register('total_cost_per_unit_t',65,0, 10, 0)
inv_resize.of_Register('total_cost_per_unit', 65, 0, 10, 0)
inv_resize.of_register('c_subtotal_cost_byproductype',65,0,10,0)
inv_resize.of_register('c_total_cost_perunit_by_phase',65,0,10,0)
inv_resize.of_register('grand_total_cost',65,0,10,0)
inv_resize.of_Register('contract_price_t',75,0, 10, 0)
inv_resize.of_Register('contract_price', 75, 0, 10, 0)
inv_resize.of_Register('total_contract_price_t',85,0, 10, 0)
inv_resize.of_Register('total_contract_price', 85, 0, 10, 0)
inv_resize.of_register('c_subtotal_contractprice_byproductype',85,0,10,0)
inv_resize.of_register('c_total_per_phase_contractprice',85,0,10,0)
inv_resize.of_Register('grand_total_contract_price', 85, 0, 10, 0)
inv_resize.of_Register('tbl_bid_products_has_component_y_n',95,0, 5, 0)
ELSEIF this.dataobject = 'd_bid_product_list_group_1_paid_item' THEN
//// Args - PercentageX, PercentageY, PercentageWidth, PercentageHeight
//
inv_resize.of_Register('tbl_bid_products_line_number_t', 0, 0, 5, 0)
inv_resize.of_Register('tbl_bid_products_line_number', 0, 0, 5, 0)
inv_resize.of_Register('key1_t',5, 0,5, 0)
inv_resize.of_Register('key1', 5, 0, 5, 0)
inv_resize.of_register( 'c_bid_number',10,0,20,0)
inv_resize.of_Register('c_prod_name_t',10,0, 20, 0)
inv_resize.of_register('c_paiditem',10,0,20,0)
inv_resize.of_Register('c_prod_name', 10, 0, 20, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size_t',30,0,15, 0)
inv_resize.of_Register('tbl_bid_products_bid_prod_size', 30, 0, 15, 0)
inv_resize.of_Register('unit_mesur_t',45,0, 5, 0)
inv_resize.of_Register('unit_mesur', 45, 0, 5, 0)
inv_resize.of_Register('revise_qty_t',50,0, 5, 0)
inv_resize.of_Register('revise_qty', 50, 0, 5, 0)
inv_resize.of_Register('contract_qty_t',55,0, 5, 0)
inv_resize.of_Register('contract_qty', 55, 0, 5, 0)
inv_resize.of_Register('ourcost_t',60,0, 5, 0)
inv_resize.of_Register('ourcost', 60, 0,5, 0)
inv_resize.of_Register('total_cost_per_unit_t',65,0, 10, 0)
inv_resize.of_Register('total_cost_per_unit', 65, 0, 10, 0)
inv_resize.of_register('c_total_cost_perunit_by_paiditem',65,0,10,0)
inv_resize.of_register('grand_total_cost',65,0,10,0)
inv_resize.of_Register('contract_price_t',75,0, 10, 0)
inv_resize.of_Register('contract_price', 75, 0, 10, 0)
inv_resize.of_Register('total_contract_price_t',85,0, 10, 0)
inv_resize.of_Register('total_contract_price', 85, 0, 10, 0)
inv_resize.of_register('c_total_per_payitem_contractprice',85,0,10,0)
inv_resize.of_Register('grand_total_contract_price', 85, 0, 10, 0)
inv_resize.of_Register('tbl_bid_products_has_component_y_n',95,0, 5, 0)
END IF
//==========================================================
I think I am missing something in my code. Any advise will be greatly appreciated.
Regards,
Clarence.
Based on what John says about the PFC resizes behaviour / implementation - I would also suggest trying to implement the DW Control via its User Object. That way you can use the OpenUserObject() / CloseUserObject() command to reinstate a "Fresh" instantiation of the DW Control when swapping DWO's within the control. Food for thought. ;-)
HTH
Regards ... Chris
@Clarence - If you have not done so already, look at the of_SetOrigSize(width,height) method of the DW Resize Service object. It MAY be possible to "reset" the resize logic after swapping the data object and registering a new set of DWObjects. I've not attempted this, so I cannot say with any certainty that it will work, but you might wish to try it.
Because I did not register the original size of the dw; pfc_resize did not know any changes on the size of the dw and so did not go thru the loop of all the object. Now it does know the original size and knows there is a change in size and goes thru the loop with the columns and resize everything correct.
Thank you again Dr.Po you are a genius.
Regards,
Clarence