NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: peterH on February 22, 2011, 02:10:28 PM

Title: Error in template - 5.16
Post by: peterH on February 22, 2011, 02:10:28 PM
Hi Bruce,

I couldn't make example 28 compile so i went to the template to check.
In NetWeb.tpw line 3279 pos 151 there's an apostropy that shouldn't be there.

Maybe it's missing somewhere else <g>

Peter
Title: Re: Error in template - 5.16
Post by: peterH on February 22, 2011, 03:28:54 PM
But wait, there's more.

When you've got an other button in a browse and this button has a url defined then the generated html is missing a semicolon. The code happens to be generated from the same template line as above.

I can't figure out how to fix this one. Probably you're html encoding it somewhere in the dll or something.

However, the resulting effect of this missing semicolon is that you get a 404 - so maybe this is related to the Page not found post below.

Peter
Title: Re: Error in template - 5.16
Post by: Robert Iliuta on February 23, 2011, 12:28:06 AM
Hallo Peter,

Re-download and register again the template and all will be fine.

Robert
Title: Re: Error in template - 5.16
Post by: Bruce on February 23, 2011, 12:53:06 AM
the first issue is corrected in the current file - but the second I need to look into. I'll keep you posted.
Title: Re: Error in template - 5.16
Post by: Bruce on February 23, 2011, 03:53:03 AM
I've added the ; to the code, but strictly speaking it's not necessary unless there is more JavaScript on the button.

If you want to try the fix there though, open your \libsrc\netweb.clw file, look for Window.Open, and change it to be the following;

!------------------------------------------------------------------------------
NetWebServerWorker.WindowOpen    Procedure(string pUrl, <String pTarget>)
  code
  if lower(sub(pUrl,1,6)) = 'mailto'
    return 'window.open(''' & clip(pUrl) & ''',''_self'');'
  elsif  omitted(3) or ptarget = '' or ptarget = '''''''' or ptarget = '_self'
    return 'location.href=' & self._MakeURL(pUrl)
  else
    return 'window.open(''' & self._MakeURL(pUrl) & ''',''' & clip(pTarget) & ''');'
  end

notice the <> turning into = on the line after code, and also the two "return" lines
that end in ;

cheers
Bruce

Title: Re: Error in template - 5.16
Post by: jorgemir on February 23, 2011, 04:42:38 AM
missing : in conditional expression
http://168.144.197.26:4321/PortadaPage?nsert_btn=Insert&
Line 1

Still error on Other Button.
Title: Re: Error in template - 5.16
Post by: peterH on February 23, 2011, 05:30:24 AM
Bruce,

I tried your fix in netweb.clw and it made the 404 go away. But I don't get the new page either. Nothing happens.

So I can confirm there's a problem with Other button.

Peter

PS. FWIW I've just compiled the exact same app in 5.09 - it compiles and runs flawlessly and the Other buttons work as expected!
Title: Re: Error in template - 5.16
Post by: Stu on February 23, 2011, 01:21:41 PM
EDIT: It's a problem with not having double-quotes around the url, if the url has an equals sign in it.

Firebug shows that every time I click on one of my other buttons, I get the error: "invalid assignment left-hand side"

Pic following:



[attachment deleted by admin]
Title: Re: Error in template - 5.16
Post by: Bruce on February 24, 2011, 01:04:58 AM
The call to location.href is already inside double-quotes;

onclick="location.href=PrintStub?bob=one&amp;fred=two&amp;MAI__MailBoxNumber=3&amp;PressedButton=print_btn"

Cunningly, in JavaScript double-quotes or singgle-quotes can be used to deliminate a string. So instead of trying to insert double-quotes around the location.href setting, we can use single-quotes. So it becomes;

onclick="location.href='PrintStub?bob=one&amp;fred=two&amp;MAI__MailBoxNumber=3&amp;PressedButton=print_btn'"

To make this change in the current build, go to the netweb.clw file, windowOpen method. replace the location.href line there with;

return 'location.href=''' & self._MakeURL(pUrl) & ''''

This fix will obviously be in 5.17

cheers
Bruce
Title: Re: Error in template - 5.16
Post by: Stu on February 24, 2011, 03:43:54 AM
Awesome sauce!
Title: Re: Error in template - 5.16
Post by: jorgemir on February 24, 2011, 06:03:40 PM
I'm trying to use Other button to insert data from one table into a different table. Now that Other button works, I see that I can not get the p_web.GSV('Field') that contains (suposedly) the row id that Other exports to the form. Or I'm doing the wrong thing.
I use
Pro:codigo=p_web.gsv('Pro:codigo')  ! Being Pro:Codigo the key field of the browse table
if access:productos.fetch(Pro:codkey)
else
    p_web.ssv('Codigo',clip(pro:codigo))
    p_web.ssv('Descripcion',clip(pro:descripcion))
    p_web.ssv('PVP',clip(pro:pvp)
end

Now, this is coded in After Opening Files. Nothing comes from the row id and nothing is readed from the file

am I wrong?

Thanks
Jorge
Title: Re: Error in template - 5.16
Post by: Bruce on February 24, 2011, 07:41:35 PM
Jorge, can you move this to it's own thread please?