Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Can't set value in switch with EnableValue
Can't set value in switch with EnableValue [message #14557] Mon, 03 March 2008 19:09 Go to previous message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
I'm trying to set a switch option from a database which stores an string (which is the value for the switch as I set them first).

This is the code:

UserEditWindow::UserEditWindow(String sel)
{
	CtrlLayout(*this, sel == "" ? "Nuevo Usuario" : "Editar Usuario " + sel);
	
	pwd.Password(true);
	optUserClass.Set(0, "ROOT", "Root (Administrador, privilegios totales)");
	optUserClass.Set(1, "FULL", "Full (Usuario completo, puede realizar altas)");
	optUserClass.Set(2, "CONSULTA", "Consulta (Restringido a realizar consultas)");
	
	if (sel == "")
	{
		editing = false;
		optUserClass.EnableValue("ROOT");
	}
	else
	{
		editing = true;
		
		// llenar campos 
		
		Sql sql((*(G_STATE->GetPsqlSession())));
		loginName = sel;
		realName.SetData(sql % Select(NOMBRE).From(OPERADOR).Where(LOGIN == sel));
		pwd.SetData(sql % Select(PASSWORD).From(OPERADOR).Where(LOGIN == sel));
		optUserClass.EnableValue(sql % Select(CLASE).From(OPERADOR).Where(LOGIN == sel));
	}
	
	// registra callbacks
	
	btnCancel.WhenAction = THISBACK(Close);
	btnOk.WhenAction = THISBACK(Save);
}


The line:


optUserClass.EnableValue(sql % Select(CLASE).From(OPERADOR).Where(LOGIN == sel));

it's where where the data is retrieved from the DB to set the switch value (and I retrieve the correct data, strings such as ROOT,FULL,CONSULTA are taken OK from the DB table).

I don't know why this does not work, since i'm setting the related values-text at first.

Thx for your help.


[Updated on: Mon, 03 March 2008 19:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Images in menus causing enormous padding
Next Topic: How to modify Page setup (left margin) in RichText Control
Goto Forum:
  


Current Time: Thu May 16 12:15:33 CEST 2024

Total time taken to generate the page: 0.02494 seconds