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

Home » RADICORE development » Framework » DropDown Field values - changing in runtime
Re: DropDown Field values - changing in runtime [message #7697 is a reply to message #7696] Fri, 11 March 2022 09:53 Go to previous messageGo to previous message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I split the compound key into its component parts in _cm_updateFieldArray() with the following code:

$str_gr_art = $postarray['gr_art_dropdown'];

if (isset($postarray['gr_art_dropdown'])) {
$gr_key_array = explode('&', $str_gr_art);

// weist die Daten $GLOBALS zu
$GLOBALS['gr_key_array'] = $gr_key_array;

// liest die Schlüsselwerte der ausgewählten Größe ein
$fieldarray['gr_art'] = $gr_key_array[1];
$fieldarray['gr_art_sub'] = $gr_key_array[2];
$fieldarray['gr_art_rdc'] = $gr_key_array[3];

// ermittelt die Größen-Werte aus orga_groessen_ausr_detail
$dbobject =& RDCsingleton::getInstance('orga_groessen_ausr_detail'); // Instanz für Lookup-Tabelle

$dbobject->sql_select = 'gr_art_ausr, argroesse_desc';

$where = "gr_art='{$fieldarray['gr_art']}' AND " .
"gr_art_sub='{$fieldarray['gr_art_sub']}' AND " .
"rdcaccount_id='{$fieldarray['gr_art_rdc']}'";

// sortiert die Daten
$dbobject->sql_orderby = 'argroesse_desc';
$data = $dbobject->getData ($where);

// weist die Werte der Lookup-Variablen zu
foreach ($data as $row => $rowdata) {

$rowvalues = array_values($rowdata);
$array[$rowvalues[0]] = $rowvalues[0] . ' - ' . $rowvalues[1];

} // foreach
}

But the code is in my opinion not the problem. The numeric field has the same behaviour even if I set the above code in /* */

If I change the value of the numeric field before changing the dropdown field from 50,00 to 50,0, the numeric field will be increased to 500,00. If I change the value to 5 the value will not be increased but changed to 5,00. 5,0000 will be changed to 50.0000,00 and so on.
Changing the value of the numeric field to 5.00 (. instead of ,) increases the value by the factor of 100 and so on..

If I delete the code "$this->fieldspec['gr_art_dropdown']['javascript'] = array('onchange' => 'this.form.submit();');" in _cm_changeConfig(), nothing happens, the numeric field doesn't change the value.

[Updated on: Sat, 12 March 2022 09:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing screen look
Next Topic: Importing default values -> enclosed in quotes
Goto Forum:
  


Current Time: Thu Nov 28 05:47:54 EST 2024

Total time taken to generate the page: 0.01512 seconds