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

Home » RADICORE development » Bug Reports » replaceScreenColumns does not work in all cases
replaceScreenColumns does not work in all cases [message #2377] Mon, 23 November 2009 18:57 Go to next message
ljkbrost is currently offline  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 messageGo to next message
AJM is currently offline  AJM
Messages: 2368
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.


Re: replaceScreenColumns does not work in all cases [message #2379 is a reply to message #2378] Tue, 24 November 2009 04:30 Go to previous messageGo to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Hi Tony,

My screen structure is correct. If you notice the increment operator is a post increment. So we get both 'label' and 'field' records in the same array.

Are you aware of any reason why updating the code to support vertical (detail) screens would not work?

Thanks,


Kyle Brost
----
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
AJM is currently offline  AJM
Messages: 2368
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.


Previous Topic: std.update3.inc confusion
Next Topic: pdf creating fails to find file
Goto Forum:
  


Current Time: Sat Nov 23 20:51:55 EST 2024

Total time taken to generate the page: 0.01024 seconds