v8.1: Combobox settings example

Hi,

I'm trying to use the combobox control in one of my web projects but it seems Im doing something very wrong.  I've searched the documentation, even the code for the default projects and defined my control in the same way as it's done in some other modules but I get a compilation error: "Error code: CS1061; 'VI.WebRuntime.IRuntimeTable' does not contain a 'SingleRow' definition...". 

From the examples, it seems that:

  • General settings contains the collection that will hold your selection within the combobox
  • Source data collection will populate the combobox with its contents

That I've done, but still the same error. Any hints!

Have a nice weekend everyone.

Regards!

Parents
  • Hi Juan,


    Can you post the C# code (or the WebDesigner component) that the error message points to?

  • Hi Hanno,


    Sorry for the delay, but I wasnt notified of the change in the post. I've already created a support case for this.

    To explain it further, it seems that I dont get to understand the scope of variables+database objects within a web project. I've been able to reproduce the case with other objects aside the combobox control and it happens the same.

    As an example:

    1. I create a new module
    2. In Collections I add a single row collection , let's say "Variables" with two properties , OTP_Metodo and OTP_Metodo_Dato, both strings.
    3. In Functions I'm able to create a function that queries Variables, for instance, Function OpctionOTPSeleccionada() with value "if isnullorempty(from Variables select OTP_Metodo_Dato) then 0" . This compiles correctly.  And the project compiles correclty. It works.
    4. I create a form in my project. If in that form I try to query Variables in the same way as in the function, as a text for a label for instance, the module compiles correctly. However if I compile the whole porject I get the error "Error code: CS1061; 'VI.WebRuntime.IRuntimeTable' does not contain a 'SingleRow' definition...".: Here is the c# code:

    // Label2
    VI.WebRuntime.WebControls.Label Label2 = LayoutPanel1.AddControl<VI.WebRuntime.WebControls.Label>("Label2");
    #if DEBUG
    VI.WebRuntime.Debugger.InterruptManager.Instance.NotifyExecute("CCC_EPRINSA_QER_PasswordWeb_Session", "Label2", this.TableStore, _Module, Label2);
    #endif
    System.Func<string> _innerHTML = () =>
    {
    string _tmpstring2 = "Texto seleccionado : ";
    VI.WebRuntime.IDataColumn _OTP_Metodo = _UserSession.SessionModule.TableStore.GetTable("Variables").GetColumn("OTP_Metodo");
    return (_tmpstring2 + _OTP_Metodo.GetValue(_UserSession.SessionModule.TableStore.GetTable("Variables").SingleRow).Int);
    }
    ;
    string @__innerHTML = _innerHTML();
    Label2.Text = @__innerHTML;
    VI.WebRuntime.WebControls.ControlAttributeUpdater<string> Label2_updater = new VI.WebRuntime.WebControls.ControlAttributeUpdater<string>(_innerHTML, Label2, "Text", @__innerHTML);
    VI.WebRuntime.IDataColumn _OTP_Metodo1 = _UserSession.SessionModule.TableStore.GetTable("Variables").GetColumn("OTP_Metodo");
    Label2_updater.RegisterOnColumnChange(_OTP_Metodo1);

Reply
  • Hi Hanno,


    Sorry for the delay, but I wasnt notified of the change in the post. I've already created a support case for this.

    To explain it further, it seems that I dont get to understand the scope of variables+database objects within a web project. I've been able to reproduce the case with other objects aside the combobox control and it happens the same.

    As an example:

    1. I create a new module
    2. In Collections I add a single row collection , let's say "Variables" with two properties , OTP_Metodo and OTP_Metodo_Dato, both strings.
    3. In Functions I'm able to create a function that queries Variables, for instance, Function OpctionOTPSeleccionada() with value "if isnullorempty(from Variables select OTP_Metodo_Dato) then 0" . This compiles correctly.  And the project compiles correclty. It works.
    4. I create a form in my project. If in that form I try to query Variables in the same way as in the function, as a text for a label for instance, the module compiles correctly. However if I compile the whole porject I get the error "Error code: CS1061; 'VI.WebRuntime.IRuntimeTable' does not contain a 'SingleRow' definition...".: Here is the c# code:

    // Label2
    VI.WebRuntime.WebControls.Label Label2 = LayoutPanel1.AddControl<VI.WebRuntime.WebControls.Label>("Label2");
    #if DEBUG
    VI.WebRuntime.Debugger.InterruptManager.Instance.NotifyExecute("CCC_EPRINSA_QER_PasswordWeb_Session", "Label2", this.TableStore, _Module, Label2);
    #endif
    System.Func<string> _innerHTML = () =>
    {
    string _tmpstring2 = "Texto seleccionado : ";
    VI.WebRuntime.IDataColumn _OTP_Metodo = _UserSession.SessionModule.TableStore.GetTable("Variables").GetColumn("OTP_Metodo");
    return (_tmpstring2 + _OTP_Metodo.GetValue(_UserSession.SessionModule.TableStore.GetTable("Variables").SingleRow).Int);
    }
    ;
    string @__innerHTML = _innerHTML();
    Label2.Text = @__innerHTML;
    VI.WebRuntime.WebControls.ControlAttributeUpdater<string> Label2_updater = new VI.WebRuntime.WebControls.ControlAttributeUpdater<string>(_innerHTML, Label2, "Text", @__innerHTML);
    VI.WebRuntime.IDataColumn _OTP_Metodo1 = _UserSession.SessionModule.TableStore.GetTable("Variables").GetColumn("OTP_Metodo");
    Label2_updater.RegisterOnColumnChange(_OTP_Metodo1);

Children
No Data