Android Question Hide some views while redirecting to next page in B4XPages?

Hi Guys, I am new to B4X Pages, In the below project, When I click the B4XTable cell, It goes to another page with some views (Below the retrieve button) not visible, Then I click the retrieve button, All views are visible. I go back to page 1 and then click the B4XTable cell and come to page 2, I need to invisible the views below the retrieve button. It works only the first time. How to overcome this?
 
Solution
Create a public Sub in Hospital_Billing and move the lines that hide the views there:

B4X:
Public Sub HideDetails
    ilbl_patientregno.Visible = False
    ip_itemnamepanel.Visible = False
    ilbl_patientname.Visible = False
    ipnl_patientname.Visible = False
    ilbl_doctorname.Visible = False
    ipnl_doctorname.Visible = False
    ilbl_billamount.Visible = False
    ipnl_billamount.Visible = False
    ilbl_allow.Enabled = False
    ilbl_allow.Visible = False
    ipnl_allow.Enabled = False
    ipnl_allow.Visible = False
    btn_save.Enabled = False
End Sub

Call that sub from the B4XPage_Created in Hospital_Billing.

In B4XTable_Screen:
B4X:
Private Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
   
'...
Sorry Guys, I forget to attach my project. here it is
 

Attachments

  • Project.zip
    23.4 KB · Views: 55
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Create a public Sub in Hospital_Billing and move the lines that hide the views there:

B4X:
Public Sub HideDetails
    ilbl_patientregno.Visible = False
    ip_itemnamepanel.Visible = False
    ilbl_patientname.Visible = False
    ipnl_patientname.Visible = False
    ilbl_doctorname.Visible = False
    ipnl_doctorname.Visible = False
    ilbl_billamount.Visible = False
    ipnl_billamount.Visible = False
    ilbl_allow.Enabled = False
    ilbl_allow.Visible = False
    ipnl_allow.Enabled = False
    ipnl_allow.Visible = False
    btn_save.Enabled = False
End Sub

Call that sub from the B4XPage_Created in Hospital_Billing.

In B4XTable_Screen:
B4X:
Private Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
   
'    is_patientstatus = B4XTable1.GetRow(RowId).Get("Patient Status")
   
    B4XPages.ShowPageAndRemovePreviousPages("hospital_billing")
    B4XPages.MainPage.billing.HideDetails
End Sub
 

Attachments

  • Project.zip
    23.4 KB · Views: 58
Upvote 0
Solution
Thanks @LucaMs It work like a charm.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…