Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Missing scroll bar
Missing scroll bar [message #4623] Thu, 13 November 2014 21:14 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
I noticed that when you add a new entry to the $fieldarray of function _cm_changeConfig in any class, like for example:
   function _cm_changeConfig ($where, $fieldarray)
    {
    	if (!isset($fieldarray['abc'])) $fieldarray['abc'] = 'anything';
    	return $fieldarray;
    } // _cm_changeConfig

You will find that any operation on multiple records (eg. multiple selected records with enq1 or upd1, etc) of this object won't show the scroll bar. A work around is by moving the "add entry to $fieldarray" code to another function, for example _cm_getExtraData, which does not conflict with the scroll bar.
Re: Missing scroll bar [message #4624 is a reply to message #4623] Fri, 14 November 2014 04:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
The _cm_changeConfig() method is supposed to be used only to change the configuration of that entity, such as the contents of the $fieldspec array. Adding extra values to $fieldarray should be done in the _cm_getExtraData() method.

It is possible to add extra values in the _cm_changeConfig() method, but as it is called several times a change to the contents of $fieldarray can have different results. The first time it is called in an UPD or ENQ task is before the call to getData(), so the $where string is not empty and $fieldarray shows the primary key of the first selection. If you make a change to $fieldarray at this point this will then replace the contents of the $where string, thus replacing the multiple selection with a single selection which causes the scroll bar to be removed as there are no other selections. When _cm_changeConfig() is called after getData() the $where string will be empty and $fieldarray will show the complete contents of the current record. Any changes you make to $fieldarray at this point will not affect the scroll bars.

If you wrap your code in the following condition it will work in the _cm_changeConfig() method:
if (empty($where) AND !empty($fieldarray)) {
    if (!isset($fieldarray['abc'])) $fieldarray['abc'] = 'anything';
} // if


Re: Missing scroll bar [message #4625 is a reply to message #4624] Sun, 16 November 2014 13:28 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
I understand now. Thank you.
Previous Topic: DEL4 - Cannot Select Outer Table Name
Next Topic: New record not shown when using ADD2 from MULTI2
Goto Forum:
  


Current Time: Fri Apr 19 18:10:30 EDT 2024

Total time taken to generate the page: 1.19930 seconds