i have 2 views with 1 table each and 1 class with some propertys.
On the view1 table i have some dates on open handler with bellow code.
YearTable.AddSection("")
Dim cell As iOSTableCellData
For i As Integer = 2015 DownTo 1971
cell = New iOSTableCellData("Model "+ i.ToText)
cell.Tag = i.ToText
YearTable.AddRow(0, cell)
Next
And on the action handler the bellow code
Dim v as new view2
dim Cell as iOSTableCellData = YearTable.RowData(section, row)
dim tYear as text = Cell.Tag
Self.PushTo(v)
On the class named (customer) i have a property (name) tYear and Type (integer),i want to get the date from the cell.tag and use it on the view2
When i run it i get always empty but if i put break on the view1 table action i see the cell.tag to have the date.
Where i am wrong ?
Any help appreciated
Or, pass the year to the new view in the constructor. So, define a method called “Constructor” in your View2 view and give it a parameter of theYear. Then create a local property in View2 called mYear. In your Constructor method, set mYear = theYear. To call your view, do “dim v as new View2(tYear)”.
I am bit confused about this solution.
I pass the parameter “tYear as text” on the constructor on view2 and is public but i get error on the view1 when i call the “dim v as new View2(tYear)”//item (tyear) do not exist…
The value from the cell.tag i want it public all over the project!
if i make it this way bellow
Dim v as new view2
dim Cell as iOSTableCellData = YearTable.RowData(section, row)
tdata.tyear =cell.tag //tdata is the module and tYear is the property
Self.PushTo(v)
Next
to assign the value to the property is this the right method to do ?
tdata.tYear = cell.tag //tYear is property on module tdata