NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AvanIeperen

Pages: [1]
1
Web Server - Ask For Help / Re: Reload element after user input
« on: May 19, 2022, 04:49:36 AM »
Hi Bruce,

I tend to overcomplicate things. Thank you for your explenation i get now why it isn't working. :)

The updateDiv and javascript are gone. I have added my phone number list as a procedure to the fields of the tab the search field is on. I also added this procedure to the reset list of the field (on the client side tab). The result is that the list with phone numbers is now shown twice. Which makes sense because i added it to the tab. The phone number list in the header is reset and filtered when the search field updated. However the old phone number list (on the other tab) is not being reset. Is it not possible to reset a list on another tab if the tabs are not on the same form?

The easy fix would be to move the search field out of the header. But I am not quite ready to give up on the search field in the header just quite yet.

I am not able to join the webinar today, but i am keeping the option open if i can't find a sollution before the next one. :)

Thanks,
Adriaan

2
Web Server - Ask For Help / Reload element after user input
« on: May 18, 2022, 06:24:11 AM »
Hi Everyone,

I am working on a simple web app that will only be used on a number of in house mobile phones. These phone only work on our internal wifi and  app access is very restricted. Only a few certified apps are allowed. One of these is a simplified browser app.

The wep app consists of a page with a header, phone number list and a footer. Both the header and the footer are locked so only the list in the body scrolls up and down. I am using display: flex in combination with flex grow and shrink to do this. I added an input field to the header to be used as a filter for the list.
In the client side code of this field i added 'updateDiv()' and the following code to the script section:

function updateDiv()
{   
    $( "#belangrijkpagecontainer_div" ).load(window.location.href + " #belangrijkpagecontainer_div" );
}
 
Where "belangrijkpagecontainer_div" is the outer most div of the phone number list.

On to the problem i am having. This only works 50% of the time. Half the time the list is built before the update code of the filter field is called. Which makes the filter used for building the list lag behind. The weird thing it is exactly 50%. First time i enter a filter value it doesn't work, second time it does, then next time it doesn't work again and so on and on.

First time:
1. Build page
2. Build header with filter field
3. Build list
4. Update filter value
5. Build footer

Second time:
1. Build page
2. Build header with filter field
3. Update filter value
4. Build list (this time with the correct filter value)
5. Build footer

What am i doing wrong? How can i make it so reload order is always correct and not just half the time?

I have also tried to use location.reload(); but this didn't work at all. Sometimes the value of the filter field would just not get updated.

Thanks,
Adriaan

3
It works fine with two different browsers.

I didn't know this was expected behaviour. Now i have another reason to upgrade to NetTalk 8.  :)

4
Using Clarion 9.1 and NetTalk 7.39.

This error only occurs when i open 2 tabs in the same internet browser. On both tabs i go to the same browse. On tab 1 i press the change record button. The form opens. No error. On tab 2 i change a record. The form opens and shows the error "record not found: (-2) Error 30: Entry Not Found from key KAN:PK_SysID". If i press cancel and try again, the error is gone.

KAN:PK_SysID is the primary key for a topspeed file. The key has one field KAN:SysID which is autoincremented. It's set for both the browse and the form.

When the error occurs the field and session value for KAN:SysID are blank. Trying to fetch a record with ID 0 (blank) is what causes the error. I can't find what causes the session value to get set to blank.

I tried different internet browsers, same problem. I also tried the accounts (31) example, it shows the same error.

I hope someone can show me what is wrong and how to fix it. It's probably rare that a single user opens two tabs in the same internet browser and tries to open a record in the same browse in both tabs, but i can't expect this to never happen.

5
Web Server - Ask For Help / Re: My first mobile app - First question
« on: March 27, 2014, 04:12:07 AM »
Hi Bruce,

I had some problems at the start using the web form in the footer. The web form always generates a header section (mobile mode) and that messed up the real page header. Once i disabled the header on the web form it worked. The only thing i need to do now is to get the buttons to display like i want.

Thanks,

Adriaan

6
Web Server - Ask For Help / Re: My first mobile app - First question
« on: March 26, 2014, 04:44:03 AM »
Here is the zipped .app file. No .dct needed and i removed all the templates that weren't needed.

[attachment deleted by admin]

7
Web Server - Ask For Help / My first mobile app - First question
« on: March 26, 2014, 02:24:34 AM »
Using Clarion 9 and NetTalk 7.37 i started work on my first mobile app. It's still more of a test app than a real app.  ;D
It's pretty basic. It will have a fixed header, a fixed footer and four pages. Each page will have a list with data. The footer has a button for each page. Something is happening in the footer that i can't explain and i can't figure out who is doing it and why.

This is the code i use to build the footer. The footer has four buttons that can be used to go to the four pages. The button for the active page has a different color.
Code: [Select]
Footer                        Routine
  DATA
Button1Active   BOOL(FALSE)
Button2Active   BOOL(FALSE)
Button3Active   BOOL(FALSE)
Button4Active   BOOL(FALSE)

  CODE

  IF    p_web.PageName = 'page1.htm' OR p_web.PageName = 'page1' THEN Button1Active = TRUE;
  ELSIF p_web.PageName = 'page2.htm' OR p_web.PageName = 'page2' THEN Button2Active = TRUE;
  ELSIF p_web.PageName = 'page3.htm' OR p_web.PageName = 'page3' THEN Button3Active = TRUE;
  ELSIF p_web.PageName = 'page4.htm' OR p_web.PageName = 'page4' THEN Button4Active = TRUE;
  END

  packet = clip(packet) & p_web.AsciiToUTF(|
      '<div class="ui-navbar ui-navbar-noicons" data-role="navbar" role="navigation"><13,10>' & |
      '<ul class="ui-grid-c"><13,10>'                                                         & |
      NavButton('Page 1', 'page1.htm', 'a', Button1Active)                                    & |
      NavButton('Page 2', 'page2.htm', 'b', Button2Active)                                    & |
      NavButton('Page 3', 'page3.htm', 'c', Button3Active)                                    & |
      NavButton('Page 4', 'page4.htm', 'd', Button4Active)                                    & |
      '</ul><13,10>'                                                                          & |
      '</div><13,10>'                                                                         & |
      '',                                                                                       |
      net:OnlyIfUTF,net:StoreAsAscii)

  EXIT

Code: [Select]
NavButton PROCEDURE(STRING pText, STRING pLink, STRING pBlock, BOOL pActive) ! Added by LocalProcedures Template

! Start of "Local Procedures Data"
! [Priority 5000]
ButtonClassText CSTRING(512)

! End of "Local Procedures Data"

  CODE

! Start of "Local Procedures Code"
! [Priority 5000]
  ButtonClassText = '<li class="ui-block-' & pBlock & '"><13,10>'
  IF pActive THEN
    ButtonClassText = ButtonClassText & '<a class="ui-state-persist ui-btn ui-btn-active'
  ELSE
    ButtonClassText = ButtonClassText & '<a class="ui-btn'
  END
  ButtonClassText = ButtonClassText                               & |
      ' ui-btn-up-a" href="' & pLink & '" data-theme="a"><13,10>' & |
      '<span class="ui-btn-inner" aria-hidden="true"><13,10>'     & |
      '<span class="ui-btn-text">' & pText & '</span><13,10>'     & |
      '</span><13,10>'                                            & |
      '</a><13,10>'                                               & |
      '</li><13,10>'
 
  RETURN ButtonClassText

The bit to keep an eye on here are the span classes with ui-btn-inner and ui-btn-text.

This is the what i see when i look at the web page with firebug in FireFox.
Code: [Select]
<div id="pagefootertag_div" class="ui-footer ui-bar-a ui-footer-fixed fade ui-fixed-overlay slideup" role="contentinfo" data-role="footer" data-id="foo1" data-position="fixed">
<div class="ui-navbar ui-navbar-noicons ui-mini" role="navigation" data-role="navbar">
<ul class="ui-grid-c">
<li class="ui-block-a">
<a class="ui-state-persist ui-btn ui-btn-active ui-btn-inline ui-btn-up-a" data-theme="a" href="page1.htm" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-inline="true">
<span class="ui-btn-inner">
<span class="ui-btn-text">
<span class="ui-btn-inner" aria-hidden="true">
<span class="ui-btn-text">Page 1</span>
</span>
</span>
</span>
</a>
</li>
<li class="ui-block-b">
<a class="ui-btn ui-btn-inline ui-btn-up-a" data-theme="a" href="page2.htm" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-inline="true">
<span class="ui-btn-inner">
<span class="ui-btn-text">
<span class="ui-btn-inner" aria-hidden="true">
<span class="ui-btn-text">Page 2</span>
</span>
</span>
</span>
</a>
</li>
<li class="ui-block-c">
<a class="ui-btn ui-btn-inline ui-btn-up-a" data-theme="a" href="page3.htm" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-inline="true">
<span class="ui-btn-inner">
<span class="ui-btn-text">
<span class="ui-btn-inner" aria-hidden="true">
<span class="ui-btn-text">Page 3</span>
</span>
</span>
</span>
</a>
</li>
<li class="ui-block-d">
<a class="ui-btn ui-btn-inline ui-btn-up-a" data-theme="a" href="page4.htm" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-inline="true">
<span class="ui-btn-inner">
<span class="ui-btn-text">
<span class="ui-btn-inner" aria-hidden="true">
<span class="ui-btn-text">Page 4</span>
</span>
</span>
</span>
</a>
</li>
</ul>
</div>
</div>

Each button is wrapped in extra span classes. This affects the way the buttons are displayed. Where do these extra span classes come from? Is there a way to disable this behaviour?

If i remove the span classes from my NavButton code the extra span classes are gone from the web page. But aria-hidden="true" is missing. Is there is a way to add that?
Code: [Select]
<li class="ui-block-a">
<a class="ui-state-persist ui-btn ui-btn-active ui-btn-up-a ui-btn-inline" data-theme="a" href="page1.htm" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-inline="true">
<span class="ui-btn-inner">
<span class="ui-btn-text"> Page 1 </span>
</span>
</a>
</li>

I hope someone can clear this up for me.

Btw if i am being stupid and doing stuff the hard way please point out how things are supposed to be done. :) I am still trying to figure out how all the different pieces fit together, the obvious easy sollutions are not that obvious to me yet.

Adriaan

8
Web Server - Ask For Help / Re: Mobile and desktop mode confusion
« on: February 20, 2013, 12:15:48 AM »
The tablet handles desktop mode well. But the problem is the automatic switching between modes. It doesn't happen when i use a desktop and it doesn't happen when i use an iPhone.

9
Web Server - Ask For Help / Mobile and desktop mode confusion
« on: February 19, 2013, 06:27:38 AM »
Using NT 7.05. In the webhandler i have the site mode set to "Detect".

I open the website on my tablet (Asus transformer TF700). It is in mobile mode.
I press a link and goto the next page on the website. It is still in mobile mode.
I press the back button and go to the first page. It is now in desktop mode.
No matter which page i try the website stays in desktop mode.
I have to restart the browser to get back to mobile mode.

What is causing this problem? Is there anything i can do to fix this besides setting the site to mobile mode only?

Also sometimes when i open the first page of the website the layout will be mobile mode but the width will be desktop mode. I think this is probably due to some bad css on my part.

10
Hi Bruce,

This first project only has a couple of static pages. Future projects will most certainly contain browses and forms and anything else i can think of that can be stored in a database.

If i create a webpage with something like wysysyg builder it creates header, body and footer, basically all the stuff you would need to make it a complete webpage. Can i simply include this in a dynamic page with <!-- Net:f:xxx or would i need to remove things like header and footer?

Cheers,

Adriaan

11
I have been using NetTalk for a couple years. Until recently i only used it for communication between programs. Now i am taking my first step in the world of web programs. I decided to start with something easy. It's a simple website that contains some pages with static information, no database, no fields, no hassle just a couple of pages with information with maybe an image or two.

After watching webinar episode 19 i built some static html pages added the NetTalk comments just like in the webinar, dumped the pages in the web folder and served it with a NetTalk webserver. This works. Hooray.

Then i watched the NetTalk Webshop recordings. In one of them Bruce said static "'bad" dynamic "'good"'. What would be the best way to put static information in a dynamic website? By best i mean not to much hard work to build and maintain.


Pages: [1]