replaceScreenColumns does not work in all cases [message #2377] |
Mon, 23 November 2009 18:57 ![Go to next message Go to next message](/theme/default/images/down.png) |
ljkbrost
Messages: 59 Registered: April 2006
|
Member |
|
|
Hi,
When I have a screen file defined like:
$row=5
$structure['main']['fields'][$row] = array('list1'=>'list1');
The following call works as expected:
$replace_array['list1'] = array('mailing_list'=> 'Mailing List');
replaceScreenColumns($replace_array);
If I use the following screen file definition the function does not work.
$row=5;
$structure['main']['fields'][$row][] = array('label'=>'list1');
$structure['main']['fields'][$row++][] = array('field'=>'list1');
Stepping through the code it looks like the replaceScreenColumns function only handles the first case for the screen file format and not the second.
Is there a different function to use or am I using it wrong?
Cheers,
Kyle Brost
----
www.softelephant.com
|
|
|
Re: replaceScreenColumns does not work in all cases [message #2378 is a reply to message #2377] |
Tue, 24 November 2009 04:08 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Your 2nd screen structure definition is wrong. You can define a row in either of the following formats:
$structure['main']['fields'][5] = array('list1'=>'list1');
or:
$structure['main']['fields'][5][] = array('label'=>'list1');
$structure['main']['fields'][5][] = array('field'=>'list1');
Notice that in the 2nd option the label and the field MUST appear in the same row otherwise they cannot be associated with each other.
Another point to note is that both the replaceScreenColumns() and replaceScreenHeadings() functions were designed to work in a horizontal (list) display, not a vertical (detail) display.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: replaceScreenColumns does not work in all cases [message #2380 is a reply to message #2379] |
Tue, 24 November 2009 04:56 ![Go to previous message Go to previous message](/theme/default/images/up.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Those functions were not designed to work with vertical (detail) displays for the simple reason that they are not required. You can define a vertical structure with as many fields and labels as you like, but if the field is not present in the XML output then neither it nor its label will be printed.
This is unlike the horizontal (list) displays where the number of columns and their labels is fixed, and is displayed as defined regardless of what data is or is not present.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|