Jump to content

alfr

uniGUI Subscriber
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by alfr

  1. I assume you should be able to use the events on the recordset/query linked to the uniDbNavigator?
  2. alfr

    Variables

    Here are some more info how and where to declaring different types of variables http://www.unigui.com/doc/online_help/index.html?general-design-concept.htm and http://www.unigui.com/doc/online_help/handling-concurrency.htm
  3. I'd assume it would be possible to have same or different scripts in each form - and put it in the ""script" - see picture?
  4. I have no problem running it on our HyperServer on IIS. So probably something in your environment? est.exe: 000010A4: 19:17:52 [TUniServerModule]:Server Shutdown Completed. test.exe: 000010A4: 19:17:52 []:<--------------------------------------------------------------> test.exe: 000010A4: 19:17:52 [Terminated]:Exit Code: 0 test.exe: 000013B4: 19:18:04 []:>--------------------------------------------------------------< test.exe: 000013B4: 19:18:04 [TUniServerModule]:Server First Init. test.exe: 000013B4: 19:18:04 [TUniServerModule]:Node Id = 0 test.exe: 000013B4: 19:18:04 [TUniServerModule]:Node MaxSessions = 250 test.exe: 000013B4: 19:18:04 [TUniServerModule]:Starting HTTP Server on Port: 16384... test.exe: 000013B4: 19:18:04 [TUniServerModule]:HTTP Server Started on Port: 16384 test.exe: 00002BC8: 19:18:35 [Requested Theme File not found:]:C:\uniGui\Framework\unigui\uni\css\uni-xtheme-classic.css test.exe: 00002BC8: 19:18:35 []:TUniThemeProps: File not found: C:\uniGui\Framework\unigui\uni\css\uni-xtheme-classic.css test.exe: 0000354C: 19:18:54 []:Node-0, Terminate Started. test.exe: 000013B4: 19:18:55 [TUniServerModule]:Shutting Down Server. test.exe: 000013B4: 19:18:55 [TUniServerModule]:Stopping HTTP Server. test.exe: 000013B4: 19:18:56 [TUniServerModule]:HTTP Server Stopped. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Terminating Session manager. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Stopping Cache Eraser... test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Cache Eraser Stopped. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Destroying Worker Threads. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Session manager terminated. test.exe: 000013B4: 19:18:56 [TUniServerModule]:Server Shutdown Completed. test.exe: 000013B4: 19:18:56 []:<--------------------------------------------------------------> test.exe: 000013B4: 19:18:56 [Terminated]:Exit Code: 0 test.exe: 00001864: 19:18:56 []:>--------------------------------------------------------------< test.exe: 00001864: 19:18:56 [TUniServerModule]:Server First Init. test.exe: 00001864: 19:18:56 [TUniServerModule]:Node Id = 0 test.exe: 00001864: 19:18:56 [TUniServerModule]:Node MaxSessions = 250 test.exe: 00001864: 19:18:56 [TUniServerModule]:Starting HTTP Server on Port: 16384... test.exe: 00001864: 19:18:56 [TUniServerModule]:HTTP Server Started on Port: 16384
  5. As I wrote: I've tried a lot of different things, but when getting down to these details around the ExtEvents in uniGui, it's quite time consuming as it is sometimes hard to know what is possible. In the end I've succeded with my needs by doing two things. 1. First I managed to change the default sort order on the complete grid by doing the following. function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { oldStore.getSorters().$sortable.setDefaultSortDirection('DESC'); } I had to use "oldStore", as "store" seem not to be populated? (Extjs7?) 2. As the first column should continue to have default sort set to ASC, I instead did a bit ugly hardcoding to always sort it ASC. (There is no need to sort this alpha string column descending). function headerclick(ct, column, e, t, eOpts) { if (column.dataIndex == 0) { column.sort('ASC'); } } So not exactly what our client wanted to have, but almost. But a problem is that these kind of things takes quite much time to nail down...
  6. Hi, Thanks for getting back. I've already search much in the forum and the web to try to get a solution, but my skills in JavaScript is not that good. The post that you are referring to sets the sort on an column to Ascending, but what I'm after is to change/set the toggleSortState initial value on some of the columns as many of the numeric columns should sort Ascending when a user later clicks on one of them. I thought it would be quite easy(?) to do this change for a person more into JavaScript, but perhaps it's not that easy? Regards Alf
  7. In an uniDbGrid I need to change the default sort order on some of the columns when a user first clicks on the column header. The default sort order is Ascending, but on column 3, 4, 5, 6, 7, 8 I need to instead have the sort order Descending when user do first click on column (and then if click again Ascending). How can the following Sencha js-code be applied to reconfigure the uniDbGrid toggleSortState function on columns[2..7]? columns: [{ dataIndex: 'id', text: 'ID', width: 50, toggleSortState: function() { if (this.isSortable()) { var me = this, grid = me.up('tablepanel'), store = grid.store, sortParam = me.getSortParam(), direction = undefined; if(!store.getSorters().get(sortParam)) { direction = 'DESC'; } this.sort(direction); } }, } Sencha fiddle sample: https://fiddle.sencha.com/#fiddle/17u2&view/editor UniGui Professional 1.90.0.1537
  8. alfr

    Uniframe close

    Believe easiest is to keep a reference/variable to the frame in the parent form when you create the frame. Then you just can do FreeAndNil(TheFrame);
  9. Not sure I exactly understand what you say is your problem. You wrote Safari. But the header is very white and doesn't look like Safari? Also there is perhaps also a mixup between the theme-color and apple-mobile-web-app-status-bar-style? (Also your end comment characters look a bit different, but perhaps only in the post? "-->" instead of-- >?) To my understanding the theme-color is not supported by Safari but by Chrome on Android. Safari On Safari/iPhone, you can make the status bar more be a part of the WebApp by the following meta setting - as I wrote earlier in my first post. So if your problem is Safari - that your status bar is not the correct color, (if it's white and not blue), also take a look at the color settings in the server module - change the properties BgColor and BgColorlogin to your color/ clblue / $1B3766. (And when active - do a new link on the homepage to the app). (I assume you have the correct back color on your forms/pages...)
  10. Hi, You need to add them in the servermodule - as "CustomMeta" For it to work you then as well need to add the url/web app on the home screen - and start the webapp from the homescreen Alf
  11. I believe Kenneth is not referring to the indy client. Instead the delphi native one - that is built on the windows version (works on modern versions of windows). uses System.net.Httpclient; var Http: THttpclient; Shorted working example from unigui Http:=THttpclient.Create; try Res:=Http.Get('https://integration.com/api/v2/orders/' + OrderID.ToString + '?token=' + TheirToken); if Res = nil then begin ShowMessage('Error in retrieving OrderID ' + OrderID.ToString + ' from X! Respons is empty!'); exit; end; if Res.StatusCode = 200 then begin TheOrder:=TOrderClass.FromJsonString(Res.contentasString(Tencoding.UTF8)); end else begin ShowMessage('Did''t get Result 200 in reply from X! Result = ' + Res.StatusCode.ToString + ' ' + Res.StatusText); end; finally Http.Free; end; Some more info from Embarcadero http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Net.HttpClient.THTTPClient But perhaps your problems indicate some other problems in your code? Are you perhaps creating the client to early? Would suggest that you create it as my sample - in the procedure where you use it.
  12. Not sure I understood the use of CD in combination with unigui. But you can’t push data from the server to the various client sessions, instead the clients needs to pull the data/info from the server.
  13. One option is to instead of setting the fontawesome as an image, instead put the html directly in the Button.caption. Below a button with the fontawesome as an image to the left and as button.caption with html to the right (green) <i title="" class="fa fa-lg fa-address-card" aria-hidden="true"; style="color:#6cd649; cursor:pointer; margin: 0px 0px 0px 0px;"></i>
  14. For getting the remote ip, use instead - UniSession.RemoteIP I've also had some problems using the ClientInfoRec. I came to the conclusion that it can be used first after the first form is shown. So in the form's AfterShow Event. An alternative is to take it directly from UniSession.UserAgent text. But depending on what you are after there is also some interesting info in UniApplication.UniPlatform For example to get the user's device function GetUserDevice: String; begin if (upiPad in UniApplication.UniPlatform) then Result:='iPad' else if (upiPod in UniApplication.UniPlatform) then Result:='iPod' else if (upiPhone in UniApplication.UniPlatform) then Result:='iPhone' else if (upAndroid in UniApplication.UniPlatform) then Result:='Android Device' else if (upDesktop in UniApplication.UniPlatform) then Result:='PC' else Result:='unknown!'; end; or some other kinds.. var uPlat: TUniPlatforms; uPlat := UniApplication.UniPlatform; function TMainForm.DetectDeviceType: string; begin if (upPhone in uPlat) then Result := 'Phone' else if (upTablet in uPlat) then result := 'Tablet' else if (upDesktop in uPlat) then result := 'PC'; end; function TMainForm.DetectModel: string; begin if (upiPad in uPlat) then Result := 'iPad' else if (upiPod in uPlat) then Result := 'iPod' else if (upiPhone in uPlat) then Result := 'iPhone' else if (upAndroid in uPlat) then Result := 'Android Device' else if (upDesktop in uPlat) then Result := 'PC'; end; function TMainForm.DetectOperationSystem: string; begin if (upAndroid in uPlat) then Result := 'Android' else if (upiOS in uPlat) then Result := 'iOS' else if (upDesktop in uPlat) then Result := 'Desktop OS'; end; function TMainForm.DetectPlatform: string; begin if (upDesktop in uPlat) then result := 'Desktop' else if (upMobile in uPlat) then result := 'Mobile'; end;
  15. hmm - you probably need Farshads eyes... Believe you have checked most parts... But perhaps then as well: Are you sure no rubbish before in the cfg files? Not sure if a Utf-8 BOM in the start of the file could impact? (Do you get another error if renaming the cfg/run without the cfg and recycle the app-pool.) Is also the exe-file now 32-bit? Perhaps also see if you can upload a new exe through the hyper server gui or not.
  16. I assume you have recycled the application pool as well? Perhaps looks a little strange that you have both "ap" and "app" below "Default Web Site"? Perhaps instead setup ptest.dll as a default document in the Ap site. (That is how I do it.) Does log-files in log/ptest_dll/A2020-09-23.log exist and look ok? Does it work to use the /server param last after complete url ? Are the ISAPI extensions installed ok? (Your have an alert that I don't see.)
  17. Yes, I've hade some trouble with the mobile version as well in the passed... It's not as forgiving and proven as the desktop version. So I prefer to use desktop. But anyhow did a mobile version of the Scorecard layout as well... As you say mobile version has some limitations that would be good if they were sorted. GolfScorecardLayout_mobile.zip
  18. alfr

    Locking IIS

    One way forward could be to investigate/understand when the used memory increases. Does this happens without user interaction or when users are doing anything special. As you only have few users it should be easy to get more info around just by trying your self while looking on memory usage on server. But perhaps something broken - or the system don't have enough access in some parts? Also check again that the ISAPI / App pool has been setup according to Unigui standards, and that it is not a shared pool.
  19. Took this as an exercise for myself. So has only done this a bit quick and dirty. But an example how this as well can be solved the UniGui way, with Layout, panels and labels.... So not thought at all around data - as that should be retrieved from the db. But basically the above is created in the formCreate event. (Also the scorecard data should be processed at this time, so the manual entry above should not be in...) procedure TMainForm.UniFormCreate(Sender: TObject); var r,c:integer; //Row & Col SimplePanel:TUniSimplePanel; L:TUniLabel; //The label rc:Integer; // row * 100 + col, for labelname etc s:string; begin for r := 1 to 5 do for c := 0 to 21 do begin rc:=r*100+c; SimplePanel:=TUniSimplePanel.Create(Self); with Simplepanel do begin if C=0 then begin width:=70; LayoutAttribs.Padding:='8'; end else Width:=45; Height:=45; Parent:=panelBoxes; if c=21 then Color:=$949392 else Color:=$C5DCDE; Layout:='vbox'; LayoutConfig.Margin:='0 5 5 0'; LayoutAttribs.Pack:='center'; end; L:=TUniLabel.Create(Self); with L do begin Parent:=SimplePanel; name:='lb'+rc.ToString; Alignment:=taCenter; LayoutConfig.Width:='100%'; if (r=1) then begin Font.Style:=[fsBold]; Font.Size:=12; end; if c=0 then begin Font.color:=$1B2E7D; Font.Size:=12; Font.Style:=[fsBold]; Alignment:=taLeftJustify; end else if (c=10) or (c=20) then begin Font.color:=$1B2E7D; Font.Size:=12; Font.Style:=[fsBold]; end else if (c=21) then begin Font.color:=clwhite; Font.Size:=12; Font.Style:=[fsBold]; end; case rc of 100 : Caption:='Hole'; 200 : Caption:='Yards'; 300 : Caption:='SI'; 400 : Caption:='Par'; 500 : Caption:='Score'; 101..109 : Caption:=c.tostring; 111..119 : Caption:=IntToStr(c-1); 110, 310 : Caption :='OUT'; 120, 320 : Caption :='IN'; 121 : Caption :=''; // else Caption:=rc.ToString; end; end; end; end; GolfScorecardLayout.zip
  20. I'm not so experienced with HTML, so whould probably have used a lot of panels with an uniLabel... Either built it dynamically or manually.
  21. Yes, believe you just needed a break... You should put the layoutConfig.Margin only on the labels, but have as well put it on the unicheckboxes. So believe below is more how you like to have the checkboxes? Another option you have is to use the built in FieldLabel on the uniEdit, uniCombo, uniCheckbox, but perhaps you'll then need to work more with the CSS to adjust the margins between the fieldlabel and the control....
  22. Ok, I've updated the example to do that. So then the inside height of the PanelOne needs to be allowed to be bigger than the outside - and by also setting AutoScroll=True on this panel, the scrollbar will be shown if insideHeight is larger than outsideHeight. So I've set flex=1 on PanelOne to take all space after the toolbar panel and the "25% panelTwo" have taken theirs. I moved the toolbar to have the form as its parent, and removed the Scrollbox as it is not needed, and set height=auto on the two inner panels. I also would not use align=alTop etc when using client AlignmentControl. Users (2).zip
  23. When doing layouts, there is normally not only one way to do it... So attached is probably not exactly what you want. I suppose it all depends on where the constrains should be. if the various fields are allowed to make the form higher or if the form itself should be fixed. (Design outside in or inside out...) So in this example the height is effected by the visible controls - and if the inner height is more than the form height the form scrollbar is visible. But as I wrote, probably not you asked, but at least one way to solve the changing size of the panel height when the controls are hidden/made visible. Users.zip
×
×
  • Create New...