Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified
Accepted Solution

Offline queueing: if an app is an html form, store .htaccess locally or on server?

The users of my app will be filling out the form offline more than 90% of the time. If they start the app/form offline, would the .htaccess file be stored locally(and compiled with the app?)or up on the server? Thanks!

 

Sorry for such an easy question, i'm waiting for a new set of code signing keys to arrive.

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

I'm confused... what does .htaccess has to do with a web form?

It would have no effect on the app, this is purely a 'server side' file that is used by Apache.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

I'm a little confused since I don't have experience with .htaccess files. 

 

I tried adding these lines today(per the Define Offline Queues instructional page) immediately after the opening part of my form code: 

 

<input type="hidden" name="x-rim-request-title" value="My Form Submission" />

<input type="hidden" name="x-rim-queue-id" value="MyOfflineQueue" /> 

 

When I try to submit offline, it says that I can't....because i'm offline. Any idea of what i'm doing wrong?

 

If it makes any difference, here is my form declaration:

 

<form id="MTForm name="MTForm" method="post" enctype-"multipart/form-data" action="http://my server's ip address"/test.php">

Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

I just realized I didn't appropriately name the x-rim-request-title property. I changed it to my form id, recompiled the app, loaded it on the device...and still got the same error.

 

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

I've just read the doc and this is not to be used for app developpment but for mobile websites, hosted on your server. You also need to be running Apache on the server if you want to be able to use the .htaccess method.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

Oh no! My app is a web form that will be primarily started and used while offline. Is there any way I can still achieve the offline queueing? 

Highlighted
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

It's actually very easy, just store the messages locally using localstorage and send them when you have connectivity.
--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

Thanks so much, i'll read up on that tonight.

Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

I believe the blackberry.system.hasDataCoverage function of the webworks api combined with the localStorage object is exactly what I was looking for. Thanks again for your help!

Regular Contributor
Posts: 50
Registered: ‎02-14-2011
My Device: Not Specified

Re: Offline queueing: if an app is an html form, store .htaccess locally or on server?

Can I use a client-side sql database instead of localstorage? It looks like localstorage might only be supported in BB 6.