B4J Question Trying to implement "inline editing" ... needs initializing

Andromeda

Member
Licensed User
Longtime User
Hello,

i try to implement "inline editing" on a table and follow the example. But somewhere i missed something.

Steps to the error: Open the drawer, choose "Customer" and "Click inside the table" then there is an initialize error.

There i dont know what i should initialize
 

Attachments

  • B4XPagesTest.zip
    33 KB · Views: 115

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
The problem is that you have incorrectly defined the "IE_EnterEditMode" function.

The fc.ColumnID is the columnb header name, not the type of the object

Corrected code below.

I have added the log so that you can see the ColumnID.

B4X:
Private Sub IE_EnterEditMode (FC As FocusedCell)
    'FC.PrevValue holds the current value. It can also be used later to revert changes
    Log( $"FC COlumn id = ${FC.ColumnId}"$)
    Select FC.ColumnId
        Case "Number"
            'B4XPlusMinus1.SetNumericRange(0, 100, 1)
            'B4XPlusMinus1.SelectedValue = FC.PrevValue
            'FC.View = B4XPlusMinus1.mBase
        Case "Name","Description","Adress1","Adress2"
            SetTextField
            txtInlineEditing.Text = FC.PrevValue
            FC.View = txtInlineEditing
        Case "Color"
            'B4XPlusMinus1.SetStringItems(ColorsList)
            'B4XPlusMinus1.SelectedValue = FC.PrevValue
            'FC.View = B4XPlusMinus1.mBase
        Case "Date"
            'SetTextField
            'TextField1.Text = DateTime.Date(FC.PrevValue)
            'FC.View = TextField1
    End Select
End Sub
 
Upvote 1
Top