Servoy 6.0.4

Servoy announcements

Re: Servoy 6.0.4

Postby john.allen » Fri Dec 30, 2011 12:15 pm

Thanks Juan I'm sure that works great for stopping the user from closing the FID and much more elegant than my way! However I would still like to give the user a warning dialog to tell them that they have to hit the button and I don't think that will help in web client. It works fine in smart client but just not in web client (at least in Safari, Chrome and Firefox on a Mac). It's late here and I'll try it tomorrow but I'm pretty sure I'll get the same issue with the warning dialog when the onHide is triggered.
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA

Re: Servoy 6.0.4

Postby jcompagner » Mon Jan 02, 2012 9:18 pm

John,

wat you want can't be done, i guess this:

var warning = globals.DIALOGS.showWarningDialog('Copy and Close!','Close this form by clicking the button ','OK')

is the mod_dialog module?
That works with continuations, so the return value "return false" after that will not happen when you show the dialog
so the onhide doesn't really return false but generates an exception and returns "undefined" and then we just close the dialog

What you need to do is not use the mod_dialog module, but really show another modal dialog (jswindow) there.
and do return false, then in that modal dialog you have stuff that can really close that main modal dialog or something like that (by booleans which is already suggested )
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 6.0.4

Postby ROCLASI » Mon Jan 02, 2012 9:46 pm

That would work.
But only for dialogs that don't give an option as in "close dialog or not" because the code where this dialog was called from is already moved on. So the main dialog is already closed or blocked from closing depending on the return value.

So I guess the real solution to this is to have control over the X control itself. If we can hide/disable it then the user would never be able to trigger the onHide in this manner.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Servoy 6.0.4

Postby john.allen » Tue Jan 03, 2012 10:26 am

If I understand it correctly I would also very strongly support Robert's suggestion. ff you want a user to only be allowed certain actions, the best, cleanest, most elegant solution is to limit the actions that they can take in the first place. So, if there is a modal dialog and you don't want the user to be able to close the dialog in any other way, then it is better if there are simply no other alternatives. Otherwise the developer has to program a way to both prevent the user closing it in other ways and inform the user that they cannot do it any other way. And for the user it is more confusing and more dialogs they have to deal with. Much better if there is no other way to 'close' the modal dialog, no 'X' or 'red dot' at all. Is that possible?

In fact I think it would be best if the default for modal dialogs was like that as generally with a modal dialog I think the developer most of the time wants to dictate the user's options. For some of the dialogs hitting the 'X' is akin to 'canceling' the action which sometimes works so no harm done. But I think generally with a modal dialog especially you want to be able to control the users response completely so better to have no other alternative visible at all for the user in the first place...
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA

Re: Servoy 6.0.4

Postby jcompagner » Tue Jan 03, 2012 11:25 am

But that is quite simply done in servoy, yes maybe there are better ways, but currently just do:

Code: Select all
var canClose = false;
onhide() { return canClose;}

onActionButtonInDialog() {
   canClose = true;
   window.close();
}


then the close button never does do anything, and you can only close it through the modal dialog itself.

if you want to show a dialog telling the users that they can't press close thats also quite easy just show another modal dialog in the onhide (but don't use the mod_dialogs plugin or something like that, just plain modal dialog with a simple form)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 6.0.4

Postby ROCLASI » Tue Jan 03, 2012 12:01 pm

Hi John,

I guess IF you do want to show a dialog using the dialogs module in the onHide then you could use the scheduler plugin to call it. This would not interfere with the onHide code since it's called from outside the onHide event. And since the JS thread is single threading the dialog have to wait in the queue until the onHide event is finished.
Of course this dialog can't be used to give a user a choice to close or not. It's just for showing a message.

So your code could look like this:
Code: Select all
function onHideWindow(event) {
   //The if statement checks if the onHide is called by the above method in which case it simply closes the FID.
   //Otherwise it gives the users a warning message and cancels the closing of the FID. Fine in smart, not in web.
   if(event.getElementName() == null && globals.g_trigger == 'btn_copyLoc') {
      globals.g_trigger = null;
      return true;
   }
   else {
   }
   plugins.scheduler.addJob("dialog_close_msg", new Date(Date.now()), globals.DIALOGS.showWarningDialog, 0, 0, null, ['Copy and Close!','Close this form by clicking the button ','OK']);
   return false;
}


Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Servoy 6.0.4

Postby john.allen » Tue Jan 03, 2012 6:29 pm

Thanks Robert and Johan. I do understand that I can PREVENT the closing of the window and now I understand how I can also give a dialog (JSWindow or modal_dialog) to tell the user why they can not shut the window by clicking the 'X'. But would it ever be possible to have the 'X' button visibility as a property of the JSWindow itself so that the user never sees it at all? That would definitely be the cleaner way to go. Johan maybe that is what you mean when you say 'currently just do:'. Does that mean that sometime we might get that visibility of the close button as a property? I can definitely work around it (and even more so now with your suggestions) but it would be really nice I think to have that property.
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA

Re: Servoy 6.0.4

Postby jcarlos » Tue Jan 03, 2012 7:07 pm

John,

I didn't read the whole thread, but what about if you try using the busy plugin in conjunction with the JSWindow? With the busy plugin you can block the user input - including preventing the user from closing the JSWindow until the method is finished. With the busy plugin you can grey out the form so that the user sees that he/she can not shut the window by clicking the 'X'.

Again, I did not read through your issue/thread. Hopefully this helps.

JC
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

Re: Servoy 6.0.4

Postby ROCLASI » Tue Jan 03, 2012 8:20 pm

Anyone who likes to have control over the visibility of this X control in dialogs I suggest you add your vote to the following feature request:
https://support.servoy.com/browse/SVY-1292


You find the Vote option under the 'More Actions' button.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Servoy 6.0.4

Postby john.allen » Tue Jan 03, 2012 8:29 pm

Thanks Robert I've done so! It seems infinitely simpler and more elegant for the developer and more intuitive for the user to have the visibility of the X control as a JSWindow property.
John Allen
Stanford University
john.allen
 
Posts: 515
Joined: Wed Jul 02, 2003 10:07 pm
Location: Stanford CA USA

Re: Servoy 6.0.4

Postby jcarlos » Tue Jan 03, 2012 8:35 pm

ROCLASI wrote:Anyone who likes to have control over the visibility of this X control in dialogs I suggest you add your vote to the following feature request:
https://support.servoy.com/browse/SVY-1292

You find the Vote option under the 'More Actions' button.


I vote for it. +1.

I also suggest that someone open a new topic under the 'Discuss Feature Requests' section, so that those that did not check the Servoy 6.0.4 thread, can vote on the 'X control in dialogs' too.

I did something similar when David suggested better ways of flagging performance issues in this same post (Servoy 6.0.4). If you haven't voted about this one, you can at this post: https://forum.servoy.com/viewtopic.php?f=8&t=17458)

Best, JC
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

Re: Servoy 6.0.4

Postby ROCLASI » Tue Jan 03, 2012 10:04 pm

Sorry Juan Carlos,

But the voting should be done ON the ticket. See the link I provided.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Servoy 6.0.4

Postby jcarlos » Tue Jan 03, 2012 10:27 pm

ROCLASI wrote:Sorry Juan Carlos,

But the voting should be done ON the ticket. See the link I provided.


I makes totally sense. I should have done the same thing with David's idea.

I am not familiar with this ticketing system. I have a question. Why the 'Affects Version/s' is showing only '5.2.11'? Does this imply 5.2.11 and newer versions? See below:

Capture.GIF


Thanks.

JC
You do not have the required permissions to view the files attached to this post.
Last edited by jcarlos on Tue Jan 03, 2012 11:08 pm, edited 1 time in total.
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

Re: Servoy 6.0.4

Postby ROCLASI » Tue Jan 03, 2012 11:00 pm

Hi Juan Carlos,

Well that is the information that the submitter (in this case Donald J Lapin) put in. One can add multiple versions when needed. I don't know if the engineers who handle the ticket will update it but I am sure they look if newer versions have the same issue.

In this case it's a feature request so yes they will certainly merge any new features they put in an older branch into the newer branches.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Servoy 6.0.4

Postby Andrei Costescu » Wed Jan 04, 2012 12:26 pm

jasantana wrote:I have also seen, that is since 6.0.3, that it is impossible to change the tabSequence of the inherited tabPanels, you cannot move them out of the sequence nor change it. Also the tabPanels added to the subclassed form, not the inherited, have a similar behaviour, you can only put them at the bottom of the sequence.

There is already a case for this: SVY-1168. See also this discussion.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Previous

Return to Announcements

Who is online

Users browsing this forum: No registered users and 17 guests