picyka
uniGUI Subscriber-
Posts
1048 -
Joined
-
Last visited
-
Days Won
34
Content Type
Profiles
Forums
Events
Everything posted by picyka
-
with TUniFormVisualizarTarefa.Create(UniApplication) do begin try ShowForm(lTarefa,lTarefaController); finally Free; end; end;
-
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.
-
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.
-
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.
-
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?
-
ServerModule->CustomMeta It's working
- 1 reply
-
- 1
-
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); }); };
-
It would be the same action as the SelectOnFocus property from UniDBFormattedNumberEdit component.
-
It would be really cool if this filter options came native to the grid
-
When the field gets focus I wanted to select the whole number for easy editing
-
Select the number when focused. Any tips from the client side..
-
Hello, anyone using this class? if so, does it open normally through google docs?
-
roweditor How to Translate RowEditor Buttons in DBGrid? [Solved]
picyka replied to Fábio Matte's topic in General
-
I believe that one of the main focuses would be quality
-
Here it is working normally.
-
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.
-
try ShowMask ('any text')); UniSession.Synchronize; ..... Reading data ..... finally HideMask; end;
- 6 replies
-
- 1
-
- tuniscreenmask
- screemask
-
(and 2 more)
Tagged with:
-
My solidarity with the Turkish people 🙏
-
it is a known bug, to get this appearance, you would have to use UniPanel and put the buttons on it
-
Any idea how to get around this?
-
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;
-
Can you add uniPageControl and uniDBGrid?