Can't set first form back to none

Questions and answers regarding general SQL and backend databases

Can't set first form back to none

Postby gstein » Tue Mar 14, 2006 5:15 pm

It seems that if in settings you set the First Form to a form and then later want to change it, you can change it to another form, but not back to none.

This is a problem for us because we turned on security and depending on who logs in we want to show them the right first form for them. We have the code working fine, but no matter what the code says, it seems the first form that is always opened is the form listed in the First Form setting.

Is there a way to turn that off?
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby ROCLASI » Tue Mar 14, 2006 5:21 pm

You can select <none>. You find it all the way at the top of the combobox list. You might have to use the scrollbar.

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

Postby gstein » Tue Mar 14, 2006 7:35 pm

I know you can select none. The problem is it doesn't work. Once you have selected a form you can later change the first form to a different form, but if you change it back to none and then apply the changes and close the window the change doesn't stick. If you open the settings window again the form name is back in the First Form field rather than none.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby bcusick » Tue Mar 14, 2006 7:46 pm

If you specify "none" the application will open to the LAST FORM you viewed when in developer.
Bob Cusick
bcusick
 
Posts: 1262
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby gstein » Tue Mar 14, 2006 7:59 pm

Bob,

The problem is I can't set it to none. Every time I do it gets changed back to the form name. Please try this.

1. Open any solution.
2. Open the setting window. Set something in the First Form field if it isn't already there. Save the changes and close the window.
3. Open settings again and change the First Form to none. Save the changes and close the window.
4. Open settings again. If yours is working like mine, the First Form field will still have a form name in it rather than none.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby bcusick » Wed Mar 15, 2006 11:04 pm

Ummm... if you're programatically having a startup method - why don't you navigate to the right form in that method?
Bob Cusick
bcusick
 
Posts: 1262
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby gstein » Wed Mar 15, 2006 11:52 pm

Bob,

That is what I am doing, but its not working. The first form setting is over-riding the code.

Here is the code that is called from the On Open method of the solution:

Code: Select all
var p = security.getUserGroups(security.getUserId());
var myGroup = p.getValue(1,2);
if (myGroup == "Accounting") {
   forms.honoraria.controller.show()
}
else {
   forms.projects.controller.show()
}


The code is definately being activated and going to the right place, but the first form that is displayed is always the one in the First Form setting.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby gstein » Thu Mar 16, 2006 10:52 am

Bob,

It seems the only way to reset the First Form solution setting back to <none> is to do it on the repository directly:

delete from servoy_element_properties
where content_id = 245

I know we shouldn't be messing with the repository data directly, but in this case it seemed there was no other option -- and it seems to have worked fine.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Startup form

Postby kbleicken » Tue Mar 21, 2006 8:03 pm

I've been wrestling with the same problem. With a suggested direction from David Workman we have a work-around.

Create a new blank form called Startup, (or whatever) and create a method called Startup_method like this;

//pulls the client_id, user_id, and user permissions level
forms.clnt_cli_frm_1.clnt_login_get_userdata();

//depending on the client_id takes user to correct form
var clientId = globals.client_id
if ( clientId == 1 )
{
forms.clnt_admin_c3net.controller.show()
}
else
{
forms.cont_con_frm_contact.controller.show()
}

Which is identical to your code. Then choose the Startup as the first form and Startup_method as the On Open Method. Then also, (don't know why both, but is necessary) have Startup run Startup_method on show. This gets the desired result.

Hope this is helpful.

K
Kurt Bleicken
[email protected]
603.686.5574
kbleicken
 
Posts: 14
Joined: Thu May 26, 2005 1:47 pm
Location: Massachusetts

Postby gstein » Tue Mar 21, 2006 10:16 pm

Thanks, but it seems to me easier/simpler/better to remove the first form setting by running:

delete from servoy_element_properties
where content_id = 245

and then just have a startup method.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby Jan Aykroyd » Tue Mar 28, 2006 9:39 pm

Hi there

Any ideas on how to do this on OS X?

Thanks
Jan Aykroyd
 
Posts: 10
Joined: Sun Oct 02, 2005 7:54 pm
Location: London

Postby gstein » Wed Mar 29, 2006 10:16 am

OS X uses the same repository, so changing the value in the repository should work fine.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm

Postby Jan Aykroyd » Wed Mar 29, 2006 12:09 pm

Thanks for that, but I'm unclear on what file I should be adjusting exactly?

Thanks

Chris
Jan Aykroyd
 
Posts: 10
Joined: Sun Oct 02, 2005 7:54 pm
Location: London

Postby gstein » Wed Mar 29, 2006 2:58 pm

you have to execute the sql in the repository database -- the database which servoy uses to store all of its object information.

You can go to Edit/Preferences/DB Servers/repository_server/edit to see what DB you are using to store the repository information.
gstein
 
Posts: 210
Joined: Tue Jul 27, 2004 2:38 pm


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 6 guests