Jump to content

Tom

Members
  • Posts

    6
  • Joined

  • Last visited

Tom's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi, try UniApplication.Restart; or UniApplication.Terminate; both routines will destory tmainmodule, wiche is representing a session. UniApplication is always valid and bound to sessions' context.
  2. Hi everybody, here you ll find a cool feature how easy you can integrate form validation in ExtJs (see screenshot above). Its a little bit similar to c# validations components. How it works: 1) Insert the following code in MainForm.Scripts property: Ext.QuickTips.init(); 2) Assign the client-side event "onafterrender" to any form element you wish validation for and add the following code to enable the validation feautre: ClientEvent.ExtEvents -> onAfterrender sender.allowBlank = false; 3) here you are... all fields with allowBlank = false will turn into red an will show an QuickTip as far as the user dont enter required text. hope it ll improve user experience of your app!
  3. Hi amit, yes you can. See ServerModule.ServerMessages property. Here you ll find the output strings and an possibility to implement a login page or an redirection to your login page as well. Here some suggestions: Assign your own html to ServerMessages.InvalidSessionTemplate. You can either implement a html form (a login page) and submit the form values back your UniGui Application for an re-login (see URLParams demo) or code a javascript wiche automatically redirects your user to a new url (i.e. your UniGui application URL). javascript command for a redirect: <script type="text/javascript"> <!-- window.location = "http://www.yourdomain.com" //--> </script> Dont know if session timeout 0 means infinity session lifetime. But you should consider, that UniGui keeps the state of any session in servers memory as long as the sessions' main module (MainModule.pas) will be destroyed. It makes sense to implent a destructor for the main module to release your own object model based on UniGui to release the memory used by a user session. Otherwise you might run out of memory very fast.
  4. Thats it.. makes things easier;) Thanks Farshad for your helpful advise!
  5. Hi Cristiano, i had an similar challange with ext do() and un() functions a few days ago.. these two functions within ext are little bit tricky without an understandig of ext object model. however.. unigui does not send out a new "page" through out the client, when changing the ClientEvents on server side after the components have been created. consider an easier way to slove your problem: 1) place a tunilabel within your form (f.e. invisible) 2) set the labels' caption to 1 3) within the client event "onmouseover" you just using the lable for checking the components state: function mouseover(sender) { if ( parseInt(MyForm.MyInvisibleLable.text) == 1) /* do what ever you like to do ... changing background,etc */ } 4) in the client event "onclick" you can modify the lables value to change the behaviour of your component function onclick(sender) { MyForm.MyInvisibleLable.text = "2"; /* will turn of the mouseover event, because its not longer 1 */ } I hope you understood the logic of this "work around". Acutally we dont have the ability to extent existing components of unigui and so no possibility to enhance an ext object with additional properties (like .tag in delphi). But you can use a a label or what ever as an "internal storage" for your components' state. Using the client events with server-free logic for the user interface makes your application faster and smoother, because not every click oder mouseover event will generate a server request. I think thats for a delphi developer (and i have been one myself since 16 years) is a new perpective of thinking to develop an application wiche balance its logic between sever and client (so you ll get a real multi tier application). hope it helps. best regards! Tom
  6. Hi, you ll find the output string "more.." within \ext-3.3.0\examples\calendar\src\WeekEventRenderer.js; there you ll be able to change the output strings. Bye the way, this information can be interessting for others as well: How to change CalendarPanel to 24-hour format? Solution: Change the file "ext-3.3.0\examples\calendar\calendar-all-patch.js" and add the following code: Ext.calendar.DayBodyTemplate.override({ applyTemplate : function (o) { this.today = new Date().clearTime(); this.dayCount = this.dayCount || 1; var i = 0, days = [], dt = o.viewStart.clone(), times; for(; i<this.dayCount; i++){ days[i] = dt.add(Date.DAY, i); } times = []; dt = new Date().clearTime(); for(i=0; i<24; i++){ times.push(dt.format('G')); // changed - the previous value is 'ga' dt = dt.add(Date.HOUR, 1); } return Ext.calendar.DayBodyTemplate.superclass.applyTemplate.call(this, { days: days, dayCount: days.length, times: times }); } });
×
×
  • Create New...