Visibility of phone regions

Hi,

I am having problems with visibility and the phone regions.  I have a form with 4 regions R1 thru R4.  Each region has a header with  R2 thru R4 having left back button to take you to the prior screen.   All the regions are set to RenderInvisibleControls and are set to Visible = false except R1 to start.
 
R2 has a phone list and is connected to R3 with a page flip control (which is also set Visible=false to start). 
R4 has phone List.
R1 has a button to build the list on R2 take you to R2.
It does this by making R1 Visible = false and the Flip Visible=true and R2 and R3 visible=true. 
The button event had to be on the OnButtonClick because the list didn't show if it was OnAsyncButtonClick (I don't know why)
The header on R2 has an OnAsyncLeftButton that make R2 thru R4 visible=false and R1 visible=true.
The phone list on R2 has an OnAsyncItemClick that does a Flip.SlideToBack.
R3 has a button to build the list on R4 and to make R4 visible=true (and make flip R2 and R3 visible=false)
The header on R3 has an OnAsyncLeftButton that does a Flip.SlideToFront.
R3 has a button to build the phone list on R4 and to make it visible=true and R2, R3 and the flip visible=false  It is sent on the OnButtonClick rather than the OnAsyncButtonClick because the list was not showing up.
The header on R4 has an OnAyncLeftButton that make R2, R3 and the flip visible=true and R4 Visible=false
 
When I click the back button on R4 it takes me to R2 instead of R3 even if I put in a Slide to Back in the event.   Should I be using the Async events for the button clicks?  Why is the list not showing filled in when I use the OnAsyncButtonClick. to go to the region.  I have tried to do List.Invalidate, List.Refresh, etc.   after building the list.  Nothing seems to show the list filled in except putting it in the OnButtonClick.
 
Sorry about the long setup.  If you need, I can send a copy of the app.
 
Thanks,
 
 
 

Actually, in the above when I click the back on R4 it shows nothing.  No region at all.  Just blank.  If I change the header on R4 to be OnLeftButtonClick then it show R2 instead of R3.  I have tried so many combination, I'm getting confused.  I tried to assign Flip.ActiveRegion to R3, but that gives me a syntax error

 
Thanks,
 
- Please make sure to also set RenderInvisibleControls to true on the Form of your application and not only on the IWiPhoneRegion controls.

- You can only assign Regions to the BackRegion and FrontRegion properties.
The ActiveRegion property can be set to arBack or arFront to decide which region is displayed.

- If the problem persists, please provide a ready to use sample project that demonstrates the issue.
You can send a ZIP file (please do not include EXE files) to mailto:help@tmssoftware.com

Hi,

I did have everthing set as RenderInvisible.  So, I have made this example and I am e-mailing it.
 
Thanks,
 

Hi,

 
Is there any progress on this?  I have taken out the PhonePageFlips
and I am able to control things using just visibility, but it does lack
the neat factor that the page flipping brings.
 
Thanks,
 

Hi,

The message below was originally sent as a reply to your email on 25th of May and re-sent on 7th of June:

 

 

1.        

a.       There was an issue with setting the IWiPhonePageFlip.ActiveRegion property to arBack.
This has now been fixed.
The update will be available with the next release of the TMS IW iPhone controls pack.

With this update your test app should work correctly if:
- ActiveRegion is set to arBack when pressing the back button on R4
- ActiveRegion is set to arFront when pressing the Goto R2 button

b.      Unfortunately it’s currently not supported to change the IWiPhonePageFlip Visible property from an async event.
I will investigate if this behavior can be improved in a future version of the control.

2.       The IWiPhoneList control is not automatically updated after an async event for performance reasons.
You can use the different Async* methods to update the IWiPhoneList asynchronously.
Please note that it’s required that the IWiPhoneList control already contains at least 1 item to be able to insert more items via an async event.

Example:

procedure TIWForm2.IWAppFormCreate(Sender: TObject);

begin

  //Add placeholder item to the IWiPhoneList

  with PL1.Items.Add do

  begin

    Caption:='Placeholder';

    Detail:=true;

  end;

end;

procedure TIWForm2.TIWIPhoneHeader2AsyncRightButtonClick(Sender: TObject;

  EventParams: TStringList);

var

  i: integer;

begin

  PL1.Items.Clear;

  for i:=1 to 10 do

    with PL1.Items.Add do

      begin

        Caption:='Test '+IntToStr(i);

        Detail:=true;

      end;

 

   PL1.AsyncItemsAdd;

   PL1.AsyncRefresh;

end;

3.       The async capabilities are explained in the TMS IW iPhone Controls pack PDF, available from the Manuals page at our website:
http://www.tmssoftware.com/site/manuals.asp

Thank you very much.  I am not sure why your e-mails are being blocked.

 
I did put the one item in the list in the create and that worked much better.
but, the first time it goes to the screen, it does not have the group in bold.
(It is a ListType := ltSettings).  So, I put 2 items in (one section and one
detail).  Now, the first section is bolded, but not the others.  This may
be something that is just happening on my iphone emulator, so I will
try it with the real iphone next. 
 
Thanks Again for all your work.
 
Joseph Gordon

There is also something else that's strange.

 
If I have 1 group 10 item in the list (it's a ltsettings list), the list
is fine.  If I go off that region (set visiblility to false) and clear that
list and add 1 group of 1 item (do the AsyncAdd and AsyncRefresh,
and make the region visible (in an asyncOnButtonClick),
it still has 10 items with the first one being the new items and
the other 9 being from before.  It's like the clear is not actually
getting rid of things
 
Thanks,
 

I changed it to a loop doing a asyncitemremove and it seems to work.

I assume when doing the loop of the asyncitemremove I need to
do:  
 
    for i:=PL.items.count-1 downto 0 do 
        PL.asyncitemremove(i);
 
I saw someone doing 0 to PL.items.count-1 and I would think
that would create a problem since half through the index would
be beyond the end since it deleted the first half already.
 
 
It doesn't matter in which order you remove the items with AsyncItemRemove.
AsyncItemRemove only removes the item from the client-side html and not from the actual Items collection.

Ahh, I see now.  It uses the index as part of the name and that name stays static.
So, if you delete item 5, then item 6 does not become item 5 etc.. 
 
I have noticed that since I am using ltSetting, if I try to clear out the entire list,
the sections are not removed.  I noticed a line in the AsyncItemRemove that
excludes the sections from being removed/  If I take this out the part that
requires .section=false, then it seems to work as I would expect.   What
is the reason for not removing the sections and is there a better way to
remove everything from a Phone list that is set to ltSettings?
 
Also, since I've been building the list in an the Async event the sections are
not in bold, nor do do that have the extra spacing between section.  If I
build it a non-async event, then the bold and extra space is there.
 
Thanks,

Unfortunately it's currently not supported to use async updates when the IWiPhoneList is set to ltSettings.

However, this is on our feature-request list to be implemented in a future version of the IWiPhoneList control.