Elemento) && ($data->Elemento->Id) > 0); $btnGuardarText = ($editMode) ? 'Guardar Cambios' : 'Guardar Nuevo'; $btnStyle = ($editMode) ? ButtonStyleEnum::BUTTON_WARNING : ButtonStyleEnum::BUTTON_PRIMARY; $lineStyle = ($editMode) ? ColorLineStyleEnum::LINE_WARNING : ColorLineStyleEnum::LINE_SUCCESS; $popupTitle = ($editMode) ? 'Editar' : 'Nuevo'; $popupSubTitle = ($editMode) ? 'Editar ' : 'Nuevo '; $display->AddButton( new FormButton( Key : 'btnGuardar', FormKey : 'frm', Child : new Text($btnGuardarText), ButtonStyle : $btnStyle, Events : [ new FormButtonOnClickEvent() ] ) ); $frmGroups = []; $frmGroups[] = new FormRowGroup( Key: 'Id', Rows: [ [ // La llave se integra como un campo oculto 'Id' => new FormRowFieldHidden( PropertyName: 'Id', ), ] ] ); $frmGroups = verGridT::GetFormOrderAndVisibility($frmGroups[0], $data); $display->AddFormFromObject( formKey : 'frm', keyFieldName : 'Id', object : $data->Elemento, fillData: true, rowGroups: $frmGroups ); $popUp = new PopUpContent( Key : 'popup', ColorLineStyle : $lineStyle, Title : $popupTitle, DismissButtonText : 'Cancelar', DismissButtonStyle : ButtonStyleEnum::BUTTON_DEFAULT, SubTitle : $popupSubTitle, Buttons : [ $display->Widgets()['btnGuardar'], ], Content : new Container( Classes: ['view-content'], Styles: [], Children: [ $display->Widgets()['frm'] ] ) ); $popUp->Draw(); $display->DrawScripts(addLoadEvent:false); ?>