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

Home » RADICORE development » Bug Reports » v 1.35 - Screen File Layout
v 1.35 - Screen File Layout [message #1330] Thu, 01 May 2008 19:37 Go to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Hi,

I have been working with the javascript functionality within the screen files and have come across a problem. When specifying the structure of a single label/field row you can use the following:

$structure['main']['fields'][] 
  = array('tracker_stop' => 'Stop Time',
                            'javascript' => array(
                            'id'=>'tracker_stop_row'));



I get the XML and HTML that I expect

      <row id="tracker_stop_row">
        <cell label="Stop Time"/>
        <cell field="tracker_stop"/>
      </row>


<tr id="tracker_stop_row">
  <td class="label"><span class="required">* </span>Stop Time</td>
  <td>
    <input name="tracker_stop" class="text" type="text" value="" maxlength="20" size="20" />
  </td>
</tr>


When I try and to use the multiple cells in a row it does not work. I've traced it to the setScreenStructure(...) function and it happens when testing if the row data is a string or not a string.

Essentially what happens is the logic causes it to jump into processing of arrays or processing key/value pairs and never switches back to handle the correct type.

My screen structure:
$structure['main']['fields'][1] = array('javascript' => array('id'=>'tracker_start_row'));
$structure['main']['fields'][1][] = array('label' => 'Date');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');
$structure['main']['fields'][1][] = array('label' => 'Time');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');


Resulting XML:
      <row id="tracker_start_row">
        <cell label="Array"/>
        <cell field="null"/>
        <cell label="Array"/>
        <cell field="1"/>
        <cell label="Array"/>
        <cell field="2"/>
        <cell label="Array"/>
        <cell field="3"/>
      </row>


All of this because the need to have the id attribute in the <tr> tag!

I don't have a fix for this code as I'm not sure if there is another way around the problem. Any ideas on that?

Suggested fix would be to unwind the logic so that every inner row is tested for array/string and then apply the logic for building the specific xml data.

Cheers,


Kyle Brost
----
www.softelephant.com


Re: v 1.35 - Screen File Layout [message #1331 is a reply to message #1330] Thu, 01 May 2008 19:45 Go to previous messageGo to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Arg... All that typing for nothing... Figured it out!

I needed to change the screen file from:

$structure['main']['fields'][1] = array('javascript' => array('id'=>'tracker_start_row'));
$structure['main']['fields'][1][] = array('label' => 'Date');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');
$structure['main']['fields'][1][] = array('label' => 'Time');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');


To:

$structure['main']['fields'][1][] = array('javascript' => array('id'=>'tracker_start_row'));
$structure['main']['fields'][1][] = array('label' => 'Date');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');
$structure['main']['fields'][1][] = array('label' => 'Time');
$structure['main']['fields'][1][] = array('field' => 'tracker_start');


Needed to change the javascript from being a key/array pair to a array/array pair. Might want to add this one to the FAQ if it's not already there.

Cheers,


Kyle Brost
----
Re: v 1.35 - Screen File Layout [message #1332 is a reply to message #1331] Fri, 02 May 2008 04:54 Go to previous message
AJM is currently offline  AJM
Messages: 2348
Registered: April 2006
Location: Surrey, UK
Senior Member
Thanks for the tip. I shall add it to my documenation.

Previous Topic: v 1.35 - JavaScript functionality
Next Topic: Search screen dissapearing second time I acccess a menu
Goto Forum:
  


Current Time: Fri May 03 12:51:14 EDT 2024

Total time taken to generate the page: 0.01045 seconds