NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rayrip on July 15, 2008, 11:54:13 AM

Title: Problem displaying data on an htm page
Post by: rayrip on July 15, 2008, 11:54:13 AM
If I just call the form as is it displays the prompts and the data (display only). However, if I call the html page I created then the form does display, prompts, text (but blank), and no data fields.

I tried adding in the obsolete <!-- Net:c:Body --> which didn't display any data (but did make a difference as my page got longer... so there is code that is still doing something with that tag). I'm using MS Expressions to create the html code.

Anyway, I'm pretty sure I've got the tags in correctly... here is the html code (by the way it doesn't matter if I take out the message tag or leave it in):

<!-- NetWebServer -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Net:c:Head -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View Movie Information</title>
<style type="text/css">
.style1 {
   border: 2px solid #800080;
   }
</style>
</head>

<body>

<table style="width: 100%; color: #00FF00;" cellspacing="3" cellpadding="3" align="center" class="style1">
   <tr>
      <td><!--Net:Message-->
<!-- Net:inv_view -->&nbsp;</td>
   </tr>
</table>
<!-- Net:c:BodyEnd -->
</body>

</html>
Title: Re: Problem displaying data on an htm page
Post by: Mike Grigsby on July 15, 2008, 12:57:24 PM
Is the code a NetWebForm, NetWebPage, or XHTML code within your form?

If it's XHTML, which is sort of the way I'm reading your message, then you should at least try it without the header and body tags. So it would be just:


<table style="width: 100%; color: #00FF00;" cellspacing="3" cellpadding="3" align="center" class="style1">
   <tr>
      <td><!--Net:Message-->
<!-- Net:inv_view -->&nbsp;</td>
   </tr>
</table>
<!-- Net:c:BodyEnd -->

And you'll have to do your CSS another way. I may have read you entirely wrong though.
Title: Re: Problem displaying data on an htm page
Post by: rayrip on July 15, 2008, 01:14:13 PM
I'm just creating a static web page in MS expressions... .then I'm adding the tags into the html. I'm not using the xhtml in the templates at all... yet. This actually works great in the browse. In the browse I call the htm file instead of the form to get the html to show up with the form inside. It does not show the data. I've been hacking some more and turned on the insert and change buttons (I'm doing view only and read only)... and with insert it brings in data, but the wrong data.... then after that the change or view buttons show that same data no matter what record you've selected in the browse.

Everything works fine if I just call the form instead of the htm form (located under form/advanced when you delete the form name in the browse template.

Thanks,

Ray

Title: Re: Problem displaying data on an htm page
Post by: Mike Grigsby on July 15, 2008, 01:42:39 PM
I think I've gotcha. You're trying to call a hand coded page but you're not grabbing the right record from the browse. Here's a tip from my growing cheat-sheet:

2. Browse - Get the value of the record after a user clicks on a row
Embed: User did something in browser | User Clicked on a row in the browse
Use: p_web.GetValue('value')
To store it for use in another procedure: p_web.SetSessionValue('AUID',p_web.GetValue('value'))

So, then, to call the page, use the value you captured from the p_web.GetValue('value') in the browse. You may not have to store it in a session value, but rather use it in you call / link to your web page. It just depends on what you need to do with it.
Title: Re: Problem displaying data on an htm page
Post by: rayrip on July 15, 2008, 02:21:05 PM
I'll look into trying that. I don't understand why I have to do an embed when it is simply calling a form (I have view buttons on each record of the browse and a view button on the screen). Like I said, this works perfectly if I just call the browse form (inv_view). But If I erase the inv_view call and put under advanced inv_form.htm (as per the docs) it should just call my web page (which is does) and put in the data (which it doesn't).

Seems like a bug to me... :-\  but I'm new.

Ray
VMT
Title: Re: Problem displaying data on an htm page
Post by: Mike Grigsby on July 15, 2008, 02:31:22 PM
To be honest, I have a hard enough time trying to figure out what I'm doing, let alone someone else!<g>  Another thing that helps me is to describe what you're doing in terms of something we all know about, like an accounting system with Customers, products, invoices, and invoice item type relationships.

If that didn't quite do the trick, look into p_web.RestoreValue('yourfield') and see if that helps.
Title: Re: Problem displaying data on an htm page
Post by: rayrip on July 15, 2008, 04:13:37 PM
I don't blame you. No problem. I'll get back after it tomorrow. Maybe Bruce has some idea's. But I guess it can't hurt to learn how to get a record anyway... I'll be needing to do that.

This is going to be a small reservation system for our video stores (the ones that have our software). It is really simple... just a list of inventory and different ways to select it... and it will show if the movie is already rented out.. then allow the customer to reserve it or put it on the waiting list after they've signed in.... then the video store will acknowledge and an email will get sent to the customer acknowledging their movie is reserved. This way the clerk will go and get the movie off the shelf and confirm it for real.

I'm going to let it run right off the video stores computer, or off the net later where I'll send files so the program can keep itself updated.

I've got a long ways to go... but it ought to be fun.

Ray
VMT
Title: Re: Problem displaying data on an htm page
Post by: Bruce on July 16, 2008, 03:49:29 AM
Hi Ray,

I think your problem may be in the URL in the browse.
ie the problem is not in the Form itself, but in the way you are calling the form.

If you check out FAQ W4, you'll see how the URL for a form needs to be constructed. It needs to know records id, action (in this case ChangeRecord) and so on.

Cheers
Bruce
Title: Re: Problem displaying data on an htm page
Post by: Poul on July 17, 2008, 10:38:30 AM
Hi Ray,
i have been playing with Expression this week, and have used it in 3 ways.

1) Saving an Expression  website/page inside a nettalk website,
This just works (if you steer away from the expression server dodads) so you can point to them just like any other url.

2) Embed a browse into an Expression Page - you need 3 tags
<!-- NetWebServer --> at the top

<!-- Net:c:Head -->
<!-- Net:YourBrowseProcedure--> 

 i placed these two together
inside an Expression <!-- #BeginEditable --> tag.

you need nettalk  4.31PR7 as bruce has added some bits to help this along.
Depending on your content you still may need to tweak things - i had to derive my own CreateImage to get the image urls just right.
in this case, an update from the expression looking browse just opens the normal nettalk form.

3) Embed an Update form - which if i understand, is what you want, I was doing the same thing except from a menu, not a browse, but i think the same principle applies, use the same tag strategy, and as you already know, the tag does not tell the form what data to populate, like you i was not sure how to do that, so my solution was to make the updateform smart, dunno if its best but it seems to work:

in my menu or in your browse set a sesssionvalue(s) to use in your updateform (like mike mentioned) before calling the tag endowed expression page.

In the procedure setup right after CODE, for the updateform, i test if the unique key is present/passed,   if p_web.Getvalue('Your:keyid') = ''

if not i assume its from an expression tag so, i set the values that the form expects
p_web.setvalue('Your:keyid'', p_web.gsv('usethistargetID'))
p_web.setvalue('Change_btn', 'Change')
i then open the file, read the target record,
do a p_web.filetosessionqueue(targetfile)
close the file
and bob's your uncle.

it works for me,  there seems to be room for some gotchas, if the target requires you to login, you might want to do more than just return, In my case i just p_web.sendstring some text back to the expression page."acess denied or some such"  i suppose you could go to a loginform...

some housekeeping on the sessionvalues,updating your browse when you return  might need to be addressed etc, but maybe it gets you started. and if you look at the values that the browse and the updateform are manipulating you might be able to continue the technique to do something fancier... so you can return to the browse cleanly.

poul



Title: Re: Problem displaying data on an htm page
Post by: Poul on July 21, 2008, 06:51:45 AM
sweet,

a couple of emails with bruce and i find

 <-- Net:myformpage?file:sysid=32&Change_btn=Change -->

is a valid tag!
Title: Re: Problem displaying data on an htm page
Post by: Bruce on July 24, 2008, 10:40:34 PM
The original problem has been fixed in 4.31 (Pr8)