Jump to content

picyka

uniGUI Subscriber
  • Posts

    1048
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by picyka

  1. picyka

    TUniForm is Open

    with TUniFormVisualizarTarefa.Create(UniApplication) do begin try ShowForm(lTarefa,lTarefaController); finally Free; end; end;
  2. picyka

    TUniForm is Open

    procedure TMainForm.UniTimerTarefasTimer(Sender: TObject); begin UniTimerTarefas.Enabled := False; if UniMainModule.GetFormInstance(TUniFormVisualizarTarefa, False) = nil then Self.LoadTarefas(False); end; This validation is done within the timer, the FreeOnClose is already set to false.
  3. Is there a way to know if a given form is open? if UniMainModule.GetFormInstance(TUniFormVisualizarTarefa, false) then I tried this rule but it didn't work.
  4. picyka

    UniTimer

    function hasTask(host, token) { try { var Http = new XMLHttpRequest(); Http.open("GET", host, false); Http.setRequestHeader('Authorization', 'Bearer ' + token); Http.send(); if (Http.status == 200) { console.log('Buscado tarefa...'); if (Http.responseText.includes("true")) { top.ajaxRequest(top.MainForm.form, '_task', ['value=true']); } } } catch (err) { console.log('Erro Tarefa:' + err); } }; procedure TUniMainModule.ExecuteTimerTarefa; begin {180000 - 3 MINUTOS} try var lUrl := Self.URL_EX_API + 'END POINT'; var lJsString := 'var TimerTarefa = setInterval(function () {hasTask(' + QuotedStr(lUrl) + ',' + QuotedStr(Self.TOKEN_API) + ');}, 180000);'; UniSession.JSCode(lJsString); except on E: Exception do TMessageUtils.Error(E.Message); end; procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if SameStr(EventName, '_task') then begin TToastUtils.Aviso('Tarefa encontrada, ja vou te mostrar!', False, 'Aviso de Tarefa',8000); UniTimerTarefas.Enabled := True; end; end; I will post here my solution, as I use API it became easier to solve. Ajax only fires when it's really needed.
  5. picyka

    UniTimer

    I have a team that checks every 5 minutes to see if there is any task to display on the screen. These timers are dangerous to use because the session may not expire. Is there any way to take care of this? Another situation, the ChainMode property from my research, this option checked only runs the timer if there is no event being processed, would that be it? Would it be good to use it in these situations?
  6. picyka

    MainForm.Script

    ServerModule->CustomMeta It's working
  7. picyka

    MainForm.Script

    I have some functions in a js file included in CustomFiles, it works perfectly. I would like to put these functions in MainForm.Script but there I had no result. async function copyText(texto) { try { await navigator.clipboard.writeText(texto); } catch (err) { console.error('Failed to copy: ', err); } }; async function pasteText(jsName) { navigator.clipboard.readText().then(texto => { let cmd = jsName + ".setValue('" + texto + "');"; eval(cmd); }); };
  8. picyka

    UnimNumberEdit

    Would anyone have any tips?
  9. picyka

    UnimNumberEdit

    It would be the same action as the SelectOnFocus property from UniDBFormattedNumberEdit component.
  10. It would be really cool if this filter options came native to the grid
  11. picyka

    UnimNumberEdit

    When the field gets focus I wanted to select the whole number for easy editing
  12. picyka

    UnimNumberEdit

    Select the number when focused. Any tips from the client side..
  13. Hello, anyone using this class? if so, does it open normally through google docs?
  14. Hello, anyone using this class? if so, does it open normally through google docs?
  15. I believe that one of the main focuses would be quality
  16. Here it is working normally.
  17. You can ask for his email, when you click send, you can trigger an email with a temporary password. When he logs in, you force him to change the password.
  18. try ShowMask ('any text')); UniSession.Synchronize; ..... Reading data ..... finally HideMask; end;
  19. picyka

    Earthquake!!

    My solidarity with the Turkish people 🙏
  20. it is a known bug, to get this appearance, you would have to use UniPanel and put the buttons on it
  21. picyka

    UniCheckComboBox

    Any idea how to get around this?
  22. If Remote Query is True then Selected[0] doesn't work. I will need that, when starting a screen, I can put some values, however, when activating the field the OnRemoteQuery must be executed. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniCheckComboBox1.Items.Add('1 - Teste 1'); UniCheckComboBox1.Items.Add('2 - Teste 2'); UniCheckComboBox1.Items.Add('3 - Teste 3'); UniCheckComboBox1.Selected[0] := True; UniCheckComboBox1.RemoteQuery := True; {If you put False, it works} end;
×
×
  • Create New...