NetTalk Central

Author Topic: Problem with Lookup browse without the pop-up option  (Read 3851 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Problem with Lookup browse without the pop-up option
« on: July 12, 2012, 10:48:51 AM »
My application has a number of form fields with pop-up lookup browses.  They are  all working fine. However, when the application is changed to mobile mode, the look-up browses used to work without the pop-up feature.   Currently in mobile mode the lookup browse appears but nothing happens with the “select” button is pressed. I turned off the pop-up option on one of the form fields with lookup browses and when compiled, the same problem occurred.  So I cannot go back to lookups without the pop-up option, it is a general problem with the non pop-up lookup browses. I tested example program web21 which is also has a field with lookup browses with the pop-up option  and in this application, the “select” button did work. I  inspected the HTML on the look up button, and I noticed the web21 example had a “dsb” in the form action that I suspect passes the return URL where as  my application did not.
Web21 lookup button action :
document.UpdateInvoices_frm.action='BrowseCustomers?LookupField=INV:Customer&Tab=0&ForeignField=CUS:ID&_sort_=&_refresh_=sort'; document.UpdateInvoices_frm.target=''; dsb(event,UpdateInvoices_frm,0,'lookup_btn','','');

My app lookup button action:
document.LoginForm_frm.action='R_COMPNY_LKUP?LookupField=RC2:COMPANY&Tab=0&ForeignField=RC2:COMPANY&_sort_=RC2:COMPANY&_refresh_=sort'; document.LoginForm_frm.target='';

Why is this happening? Have I missed entering a field somewhere?

Thanks,
Rob Kolanko

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with Lookup browse without the pop-up option
« Reply #1 on: July 13, 2012, 12:59:01 AM »
Hi Rob,

Wow - example 21 hasn't had a lot of love lately, so thanks for using it - I've updated it quite a bit for the next build - dragging it kicking and screaming into NT6.

One little bit of background worth knowing - Mobile mode is essentially always "page mode". This change is done for you in the background, and there should be only minor differences in functionality (*). For testing you can force your desktop app into page mode on the Global Extension (Web server one), Advanced tab, "Popups" = No.

It's a little hard to pick exactly where you went wrong just from the code you posted, but one thing that looks wrong is the "lookup field".
I'm guessing you have this lookup on a memory form not a "file" form right, and so it's a little less intuitive. You've got the "Field" value set to "RC2:Company" but really it should be a variable to accept the result. ie say, "loc:company".

I'm not sure if that's all that's wrong - there may be more - but that's definitly a good starting point.

(*) The reduced functionality is mostly with what you can do _on_ the lookup browse. In popup mode you can add records here, in page mode you can't.

Cheers
Bruce

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Problem with Lookup browse without the pop-up option
« Reply #2 on: July 13, 2012, 08:32:17 AM »
Hi Bruce,
In my application, I changed the "lookup field" to loc:company and made the necessary changes in the code, but that did not solve the problem. This lookup field in my previous post is just an example of one of the many lookup fields in my application. The problem is that ALL the lookup fields in my application will not return to the form after pressing the select button in "page mode". And they used to work. In "pop-up mode", the lookup fields work fine. Some lookup fields are in memory forms while others are in file forms, it does not seem to matter. It appears to me, that the form to return to after the select button is pushed, is not being sent to the browse. That is why I was looking at the HTML code for the look-up button, and the pointed out the differences between my app and the web21 in my last post.
My app lookup button action code is now:
document.LoginForm_frm.action='R_COMPNY_LKUP?LookupField=loc:company&Tab=0&ForeignField=RC2:COMPANY&_sort_=RC2:COMPANY&_refresh_=sort'; document.LoginForm_frm.target='';
Should the form page name calling the lookup browse be passed to the lookup browse in the parameters?

I was hoping my mistake was obvious, and I know that page mode used to work. However, if you cannot see the where I could have gone wrong, I will try to extract procedures from my app to send as an example.

Thanks
Rob Kolanko

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with Lookup browse without the pop-up option
« Reply #3 on: July 15, 2012, 10:06:33 PM »
Hi Rob,

>> I was hoping my mistake was obvious, and I know that page mode used to work. However, if you cannot see the where I could have gone wrong, I will try to extract procedures from my app to send as an example.

an example would be helpful I think. But the basic debug process will be;

a) check the call that generates the button and
b) check the settings for the button (as set globally on the buttons tab.)


For a, you can check the value::fieldname routine in the form. In example 21, the generated line looks like this;

packet = clip(packet) & p_web.CreateStdButton('submit',Net:Web:LookupButton,loc:formname,p_web._MakeURL('BrowseCustomers?LookupField=INV:Customer&Tab=0&ForeignField=CUS:ID&_sort_=&_refresh_=sort'),,,,,loc:fieldclass) !7

(even the !7 at the end is a clue to the template writer where the line comes from.)

If you want to restore the button to it's default settings, in the WebServer procedure then "delete" it from the list. It will automatically be re-added back to the bottom of the list.

cheers
Bruce

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Problem with Lookup browse without the pop-up option
« Reply #4 on: July 16, 2012, 07:26:17 AM »
Hi Bruce,
Deleting the "Lookup" button from the list in the WebServer procedure fixed the problem. I have never changed the global setting for this button. After recompiling, the  “dsb” function was generated in the HTML code for my lookup buttons in page mode and in mobile mode.  I may reset all the gobal buttons in my app.

Thanks,
Rob Kolanko

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with Lookup browse without the pop-up option
« Reply #5 on: July 16, 2012, 07:59:02 AM »
cool - glad it came right.
resetting all the buttons may be a good idea.

cheers
Bruce