Jump to content

picyka

uniGUI Subscriber
  • Posts

    1063
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by picyka

  1. I don't know the degree of difficulty, but it would be great if you could search by the name of the font, to avoid putting duplicates or to know its index...
  2. Hi, it's me again. Does anyone have problems with excel staying in protected mode?
  3. picyka

    ajaxRequest

    Solved, Thanks for the support.
  4. picyka

    ajaxRequest

    Follow the example. Look at the code in the servermodule -> CustomMeta Also note the code in the MainModule ExecuteTimerLigacao Notice the ajax Event on UniFrame1 it never fires demo.zip
  5. picyka

    ajaxRequest

    if (Http.responseText.includes("true")) { alert(top.UniFrameGerDadosLigacoes0.JSName); top.ajaxRequest(top.UniFrameGerDadosLigacoes0.JSName, '_call', ['value=true']); } that doesn't work either..
  6. picyka

    ajaxRequest

    TUniFrameGerDadosPadrao = classe(TUniFrame) TUniFrameGerDadosLigacoes = classe(TUniFrameGerDadosPadrao)
  7. picyka

    ajaxRequest

    What would be the correct way to trigger the ajaxRequest for a frame? top.ajaxRequest(UniFrameGerDadosLigacoes0, '_call', ['value=true']); not work.
  8. picyka

    TUniForm is Open

    Doesn't work either, well I'll keep using my workaround.
  9. picyka

    TUniForm is Open

    with TUniFormVisualizarTarefa.Create(UniApplication) do begin try ShowForm(lTarefa,lTarefaController); finally Free; end; end;
  10. 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.
  11. 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.
  12. 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.
  13. 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?
  14. picyka

    MainForm.Script

    ServerModule->CustomMeta It's working
  15. 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); }); };
  16. picyka

    UnimNumberEdit

    Would anyone have any tips?
  17. picyka

    UnimNumberEdit

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

    UnimNumberEdit

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

    UnimNumberEdit

    Select the number when focused. Any tips from the client side..
×
×
  • Create New...