Looking into the table behavior further - O4W, when in mobile mode, will attempt to turn any tables (with fewer than 6 columns) into a mobile "grid" by default. For this to work, though, you MUST also specify column headers in the table. So the following code:
o4wtablestart("myTable")
o4wtableheader("col 1")
o4wtableheader("col 2")
o4wtableheader("col 3")
o4wText("1x1")
o4wsetcell()
o4wtext("1x2")
o4wsetcell()
o4wtext("1x3")
o4wsetcell("+1")
o4wText("2x1")
o4wsetcell()
o4wtext("2x2")
o4wsetcell()
o4wtext("2x3")
o4wtableend("myTable")
will generate output like:
col 1 1x1
col 2 1x2
col 3 1x3
col 1 2x1
col 2 2x2
col 3 2x3
If you want to disable the 'grid' behavior, and instead use the jQuery Mobile "responsive table" behavior, you can do this by turning off the "turn into a grid" default behavior, and adding the "ui-responsive" class - for example, in the O4WTableStart call:
O4WTableStart("myTable", o4wmobiletableoptions("0"):"ui-responsive")
You'll still need to put the table headers in, and in addition you'll need to mark the first column in each row as a "header" as well so jQuery Mobile will "know" it's special. So, something like this:
O4WSetCell(1,1,"cell1x1",O4WTableCellOptions("","","1"))
would mark the first cell as a "header" (using the html ) rather than as a normal "detail" cell (which would use the html | markup). You would do this for each of your first column cells.
Having said all that - I'm not certain how well the jQuery Mobile/o4w Mobile responsive table works, so you might be happy enough with the default 'grid' behavior I described first, so give that a go and see if it helps?
- Bryan Shumsky
[url=https://www.revelation.com]Revelation Software, Inc.[/url]
----
=== At 15 MAY 2023 05:18PM Johan Liebenberg wrote: ===
Thanks Bryan,
Options 1 works, but that will mean a lot of reworking in a very large program.
Options 2 works by just adding these options to the my table start: o4wmobiletableoptions("0"):"ui-responsive"
So now I have this:
O4WTableStart('MyTable', O4WSizeStyle('','100%'):NoBorderStyle:o4wmobiletableoptions("0"):"ui-responsive")
And it is responsive as aspected.
Something must have changed in the jQuery mobile since OIv9.4 as this worked there in reponsive mode without having to do anything. At least that is now sorted.
Thanks :)
Johan Liebenberg
IOT Engineering
Brisbane
Australia
----
=== At 16 JAN 2024 02:24AM Johan Liebenberg wrote: ===
Hi Bryan,
Back on this issue again.
Upgraded the customers system with a brand new clean install of 10.2.1. Then I copied the tables and data from the customers system and full rdk from my development system. All good everything works except for this error again.
So I made sure that the O4W settings are identical between my development system (10.1) and the customers 10.2.1.
Previously this worked on the customers system under 10.1, it still works on my DEV system under 10.1, but now under 10.2.1, it stopped working again.
Clicking on anything does nothing. The Chrome console reports this:
[i]jquery.mobile-1.4.5.js:3089 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
at a.mobile.Navigator.popstate (jquery.mobile-1.4.5.js:3089:30)
at f (jquery-2.2.4.min.js:2:3698)
at dispatch (jquery-2.2.4.min.js:3:7537)
at r.handle (jquery-2.2.4.min.js:3:5620)
at Object.trigger (jquery-2.2.4.min.js:4:4818)
at jquery-2.2.4.min.js:4:5328
at Function.each (jquery-2.2.4.min.js:2:2861)
at n.fn.init.each (jquery-2.2.4.min.js:2:845)
at n.fn.init.trigger (jquery-2.2.4.min.js:4:5304)
at HTMLDocument._load (jquery.address-1.6.js:207:35)[/i]
I fisically checked the jQuery mobile files (...\OInsight10\o4w\jquerym\...) between 10.1 and 10.2.1 and they seem the same.
The settings are identical.
Tried all the other combinations of base and mobile versions.
What am I missing?
Johan Liebenberg
IOT Engineering
Brisbane
Australia
----
=== At 16 JAN 2024 07:26AM bshumsky wrote: ===
Hi, Johan. Sorry to hear this is causing problems again. Can you make a very, very small and focused O4W routine that demonstrates the problem so that I can try to test _exactly_ the code that you're using and see if I see the same thing? Just go ahead and email it to me and I'll give it a go.
Thanks,
- Bryan Shumsky
[url=https://www.revelation.com]Revelation Software, Inc.[/url]
----
=== At 17 JAN 2024 06:14AM Johan Liebenberg wrote: ===
Hi Bryan,
As the system is now in production and time is of an essence, I decided to try one more thing before following your advice above.
From a backup of the old 10.1 system where this works, I copied all the folders inside the o4w folder without overwritng. Just the folders and the folder contents inside the o4w folder, not the files inside the o4w folder itself.
There were quite a few missing, sorry no way of knowing as Windows Explorer just copies one to the other.
Anyway, after a web service restart everything started working again. Problem sovled.
Best I can now do is give you a copy of what is in my 10.1 o4w folder backup and you can compare that to a 10.2.1 o4w folder.
Thanks :)
Johan Liebenberg
IOT Engineering
Brisbane
Australia
----
=== At 17 JAN 2024 07:32AM bshumsky wrote: ===
Hi, Johan. Glad to hear that fixed it!
Sure, send me your o4w folder, zipped up, and I'll see if I can spot what might have been added back in by your copy.
- Bryan Shumsky
[url=https://www.revelation.com]Revelation Software, Inc.[/url]
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=86134C1BA490A446A8927835B610BC87|View this thread on the Works forum...]] |