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

Home » RADICORE development » Transaction Patterns » add5 - Data Area
Re: add5 - Data Area [message #7318 is a reply to message #7317] Thu, 18 July 2019 05:29 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
There is no sample code for every pattern in the prototype applications as the circumstances which merit their use simply do not exist. You should be aware that the _cm_getInitialDataMultiple() method is only called once when the task is started and before the screen is displayed. It has one input argument called $fieldarray which initially contains any foreign key data which links it to the parent entity. This is also used as the output argument, so what you need to do is replace $fieldarray with a collection of as many rows as you like with whatever data you like.
function _cm_getInitialDataMultiple ($fieldarray)
{
    $parent_data = $fieldarray;
    $fieldarray = array();  // clear current data

    while (...)
        // create initial data for first row
        $row = $this->_cm_getInitialData($parent_data);
        $row['field1'] = 'whatever';
        $row['field2'] = 'whatever';
        $fieldarray[] = $row;
    } // while

    return $fieldarray;

} // _cm_getInitialDataMultiple
How many rows you create in $fieldarray is entirely up to you. It may be a fixed number, or it may depend on the contents of another table.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SQL error generating list2 pattern
Next Topic: Output2 - SQL
Goto Forum:
  


Current Time: Sat Apr 20 06:13:19 EDT 2024

Total time taken to generate the page: 0.00947 seconds