FokkeZB / nl.fokkezb.loading

The widget provides a simple loading mask that can be easily styled and configured.
93 stars 18 forks source link

Tabgroup #38

Closed macazaga closed 6 years ago

macazaga commented 8 years ago

Hi I've a tabgroup window which is opened from a button from another window. When i try to show the loading event of an action the loading shows in the previous window. Is it possible to show it on a tabgroup? I've tried it creating the controller in alloy.js also but didn't worked.

<Alloy>
    <TabGroup backgroundColor="white" >
        <Tab id="tab1" title="Reservar">
            <Window id="win1" title="Reservar">
                <ScrollView id="listaBooking" />
            </Window>
        </Tab> 
        <Tab id="tab2" title="Mis Reservaciones">
            <Window id="win2" title="Mis Reservaciones">
                <ScrollView id="listaSolicitudes" bottom="0" />
                <ImageView top="20" width="1" height="1" touchEnabled="false" />
            </Window>
        </Tab> 
    </TabGroup>
</Alloy>
var myLoading = Alloy.createWidget('nl.fokkezb.loading', 'window');

function misReservaciones(){
    if (recargar == false) return;
    recargar = false;
    if (!checarInternet()) return;
    myLoading.show();
    var xhr = Titanium.Network.createHTTPClient({
        onerror: function(e){
            myLoading.hide();
            Ti.API.info(JSON.stringify(e));
            errorConexion();
        },
        onload: function(){
            myLoading.hide();
            var respuesta = JSON.parse(this.responseText);
            for (var b = 0; b < actuales.length; b++) $.listaSolicitudes.remove(actuales[b]);
            actuales = [];
            for (var a = 0; a < respuesta.length; a++){
                actuales[a] = filaYaReservada(respuesta[a]);
                $.listaSolicitudes.add(actuales[a]);
            }
        }
    });
    xhr.open('POST', ruta);
    xhr.send({
        action : 'getBookingsApp',
        propertyId: Ti.App.Properties.getString('user_property'),
    });
    setTimeout(function(){
        recargar = true;
    },3000);
}
FokkeZB commented 8 years ago

Mmm, haven't seen this myself before. Could you get me a minimal project that runs as-is so I can debug it?

macazaga commented 8 years ago

Hi looks like the problem why i´m not able to see it is because with a vertical layout the loading view goes at the bottom and is not visible.

FokkeZB commented 8 years ago

You example shows you're using the window version, not the view version.

macazaga commented 8 years ago

Indeed, but i did it a couple of hours ago with the view option and the loading view goes to the bottom of the scrollview. If I'm using the vertical layout in the window that happens. I'll try to send you later the code.

macazaga commented 8 years ago

I also found that when i show, hide, show the app crashes.

FokkeZB commented 8 years ago

Yes, the view should only be used in a composite/absolute layout, so that is as expected.

If you can get me a reproducible test case for the hide/show issue then I'll see if I can fix it.