Hi everyone,
Need your help to solve the problems below (code attached).
1. I have a widget that users can key in info and then the "Submit" button is hit, the data is saved into the pre-defined data table successfully. However, I can not make the display table on the widget get updated.
2. For example, users submit 5 rows of data and the second row is transcripted incorrectly then I want to create a "Delete" button but still have no ideas how to pick the right row to delete (on widget).
data_input = Expr(
dt = New Table( "Data Table",
Invisible,
New Column( "Sequence",
Numeric,
Formula(Sequence(1,99,1))
),
New Column( "Col1",
Numeric,
"Continuous",
Format( "d/m/y h:m:s" ),
Input Format( "d/m/y h:m:s" ),
),
New Column( "Col2",
Character,
"Nominal"
),
New Column( "Col3",
Character,
),
New Column( "Col4",
Character,
),
New Column( "Col5",
Character,
"Nominal"
),
New Column( "Col6",
Character,
"Nominal"
),
New Column( "Col7",
Character,
"Nominal"
),
New Column( "Col8",
Character,
"Nominal"
),
New Column( "Col9",
Numeric,
Format( "h:m" )
),
New Column( "Col10",
Numeric,
Format( "h:m" )
),
);
);
buffer = Expr(
Data1 = {"A", "B", "C", "D", "E", "F"};
co1 = Data1[nw["t2"]];
);
graphic = Expr(
nw = New Window( " Records ",
<<Modal,
<<Return Result,
olb1 = Outline Box( "Record Panel",
H List Box(
Panel Box( " Time ",
t1 = Calendar Box(<<Background Color( White ));
),
Spacer Box(Size(30,0)),
V List Box(
Panel Box( " Data 1 ",
t2 = Radio Box( {"A", "B", "C", "D", "E", "F"} )
),
Spacer Box(Size(0,12)),
),
Spacer Box(Size(30,0)),
Spacer Box(Size(30,0)),
V List Box(
Panel Box( " Note 1 ",
t3 = Text Edit Box( " Note ... ", << Set Width( 200 ), SetNLines( 5 )
)
),
Spacer Box(Size(0,12)),
Panel Box( " Note 2 ",
t4 = Text Edit Box( " Note ... ", << Set Width( 200 ), SetNLines( 5 )
)
),
subt = Button Box("Submit",
t1 = t1 <<Get Date;
t3 = t3 <<Get Text;
t4 = t4 <<Get Text;
dt << Add Rows({:Col1 = t1, :Col2 = co1, :Col3 = t3, :Col4 = t4})
)
),
),
),
Spacer Box(Size(0,10)),
olb2 = Outline Box( "Draft Records",
Panel Box( "",
dt << Get As Report()
),
);
);
buffer;
);
//Main
data_input;
graphic;
Good Day,