Jba - 2020-10-07

Hi,

what I try to achieve is to create a new extension that modifies some new fields that I defined to the Incident class and these new fields should appear in a new tab.
What I managed to do for the moment is specify my new fields in the datamodel.xml (and it works, it created the new fields in the database) However I did not specify the presentation tag in the file.

In the main.php in the OnDisplayRelations function I added my condition to show the new tab and I can show my fields inside of it.
Below a small preview of my main.php

...
public function OnDisplayRelations($oObject, WebPage $oPage, $bEditMode = false)
{
     if ( in_array(get_class($oObject),array('Incident')) ) {
        $oPage->SetCurrentTab('NEW TAB');
      if($bEditMode){
         $oPage->add("<input name='" . NEW_VALUE . "' class='field_value' value='" . $oObject->Get('NEW_VALUE') . "'/>")                      
       } else {
         $oPage->add("<div class='field_value'>" . $oObject->Get('NEW_VALUE') . "</div>") 
        }
   }
}

This works fine too, but what I try to manage now is, when the user is in edit/create mode, to fetch the value, the user enters in the input and set it to the $oObject. I can fetch the value in javascript but how to call the php to send the event.targe.value ?
Thank you

 

Last edit: Jba 2020-10-07