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

Home » RADICORE » How To » Drop Down Boxes 'Blank'
Drop Down Boxes 'Blank' [message #2154] Wed, 24 June 2009 05:42 Go to next message
ajwid01 is currently offline  ajwid01
Messages: 26
Registered: June 2009
Location: UK
Junior Member
Hi,

I can't believe I'm having an issue with this, as I've previously successfully implemented this... but having followed exactly the same steps as previously (or SO I think!), it's just not working for me.

Sad

I have ammended a database column control to a "DROPDOWN LIST" type, and specified a name for the 'option list'.

I have exported this new definition and ensured it appears in the dict.inc for the respective table.

    $fieldspec['late_indicator']            = array('type' => 'string',
                                                    'size' => 7,
                                                    'control' => 'dropdown',
                                                    'optionlist' => 'late_indicator',
                                                    'rows' => 3);


I have written a list of static array values within the /subsystem/text/en/language.array.inc, with the same identifier name as placed in the 'option list' field.

$array['late_indicator'] = array('Late'    => 'Late',
                                 'On Time' => 'On Time',
                                 'Early'   => 'Early');


I have entered the additional '_' functions "getExtraData" and "getValRep" into the table's class.inc.

However now, when I go to the Update section for a record in that table, the dropdown list appears but is devoid of possible entry values.

I proceeded to duplicate my efforts for a different field in the same table, just to check I wasn't making a typing error with something.

Now, I have 2 drop-down fields occurring, but neither of them are populated.

Any pointers as to where I might have gone wrong with this?

How exactly would I implement multiple drop-down list fields within 1 table class? [ I'm presuming I could incorporate them both within the same function(s), but admit I may have 'muddied' the waters by trying to do 2 at the same time here and messing up the functions. ]

My initial code for ONE dropdown would have been:

function _cm_getExtraData ($where, $fieldarray) 
    // Perform custom processing for the getExtraData method.
    // $where = a string in SQL 'where' format.
    // $fieldarray = the contents of $where as an array.
    {
        // get list for star_sign and insert into lookup array
        $array = $this->getValRep('late_indicator');
        $this->lookup_data['late_indicator'] = $array;
        
        return $fieldarray;
        
    } // _cm_getExtraData

function _cm_getValRep ($item=NULL)
   // get Value/Representation list from this table
   {
      $array = array();
	   
      if (strtolower($item) == 'late_indicator') {
         $array = getLanguageArray('late_indicator');
         return $array;
      } // if
      
      return $array;

   } // _cm_getValRep




T.

[Updated on: Wed, 24 June 2009 05:44]

Report message to a moderator

Re: Drop Down Boxes 'Blank' [message #2159 is a reply to message #2154] Wed, 24 June 2009 16:31 Go to previous message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
Does the 'late_indicator' list appear in the XML output?

Previous Topic: _cm_ListView_header
Next Topic: MULTI4 Update Problem
Goto Forum:
  


Current Time: Sun Nov 03 05:17:44 EST 2024

Total time taken to generate the page: 0.19961 seconds