NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: astahl on December 14, 2013, 08:58:05 AM

Title: Edit in Place example(s)
Post by: astahl on December 14, 2013, 08:58:05 AM
Hi,

I need some examples on how to use EIP when inserting a new record and priming fields for the insert. I have 3 fields that need to be primed and 3 field for the user to fill. They do not want to go to another form/page to add or edit the record.


I also will have tried the form as a child of the browse. But on insert and then save the form never clears it self out as one would expect.


Ashley
Title: Re: Edit in Place example(s)
Post by: kevin plummer on December 15, 2013, 05:56:24 PM
what I do is have a button that inserts a record and refreshs the browse. The user can then EIP their own info. When I create the record I prime it with whatever info I need. This is just clarion code that runs server side.
Title: Re: Edit in Place example(s)
Post by: Bruce on December 16, 2013, 03:39:46 AM
Use the Form "Priming" Tab to prime fields.

cheers
Bruce
Title: Re: Edit in Place example(s)
Post by: astahl on December 16, 2013, 04:20:53 AM
Hi Kevin and Bruce,

So Kevin, do you remove the standard Insert button from the Browse and create your own, and then put your code under it?
If you remove it then there would be nothing for you to click on to insert a new record. The only place I see that I can add a
button is on the browse row.

Bruce, I have the fields primed in the form procedure. When I press the insert button on the browse nothing happens.
No new record is added. The database is MySql and I have auto increment off in the dictionary. could that be the cause?


Ashley
Title: Re: Edit in Place example(s)
Post by: kevin plummer on December 16, 2013, 07:41:43 AM
I always embed my Browses on forms as I normally need extra buttons etc. I tend to add a del button to the browse rows when using EIP and add my own insert button to the form. You could do it the other way around, it just makes more sense to me to this way.
Title: Re: Edit in Place example(s)
Post by: astahl on December 16, 2013, 10:25:36 AM
Hi Kevin,

That's what I thought you were gonna say. HA! It still should work in my situation if I use a form where I have 3 browses on one page a Company|User|Expense. The only one that gets updated is the Expense's. Do you see any problems with this?


Ashley Stahl
Title: Re: Edit in Place example(s)
Post by: Bruce on December 16, 2013, 09:48:09 PM
>> Bruce, I have the fields primed in the form procedure. When I press the insert button on the browse nothing happens.

dos the form appear?

>> No new record is added.

I wouldn't expect a record to be added. Records are usually added when the user clicks on Save, not when the form is opened.

Cheers
Bruce
Title: Re: Edit in Place example(s)
Post by: astahl on December 17, 2013, 04:00:26 AM
Thanks to the both of you, really appreciate the advice. No back to work.


Ashley
Title: Re: Edit in Place example(s)
Post by: astahl on December 22, 2013, 05:06:01 AM
Hi Again,

Ok, I have the netwebform with 3 browses on it and one button that will insert a new Expense record for the EIP fields.
The browses are related and in this order Location|User|Expense. They display fine and work as expected.

3 questions;

1. How does one get the button under the Expense browse?

2. When clicking the "New Expense" button which is calling a source proc to add a new record, with prototype (NetWebServerWorker p_web). I receive "Page Not Found" error, What must one do to fix?

3. When the source procedure returns, how does one refresh the Expense browse to display the new record?


Thanks,


Ashley
Title: Re: Edit in Place example(s)
Post by: kevin plummer on December 22, 2013, 04:23:34 PM

1. How does one get the button under the Expense browse?

> on the form template simply move it after the last browse. The browses should be set to last on line.

2. When clicking the "New Expense" button which is calling a source proc to add a new record, with prototype (NetWebServerWorker p_web). I receive "Page Not Found" error, What must one do to fix?

> no, don't use that prototype for a normal clarion source. Unless you plan to use that source elsewhere you can just use the template button server side code in the template setting for your button.

3. When the source procedure returns, how does one refresh the Expense browse to display the new record?

> on the template setting for the button  you added you can add your browse to the refresh list.

I strongly recommend Bruce's Nettalk book - the quickest way to get from beginner to advanced user. I would also work through all the examples looking for similar things to what you want to do in your app and looking at how the examples did it.



Title: Re: Edit in Place example(s)
Post by: astahl on December 22, 2013, 05:23:33 PM
Hi Kevin,

I have both of the NetTalk books. There is nothing in the second edition for edit in place.

Thanks for the pointers, thats all I needed.


Ashley
Title: Re: Edit in Place example(s)
Post by: Bruce on December 22, 2013, 09:49:24 PM
Hi Ashley,

>> 2. When clicking the "New Expense" button which is calling a source proc to add a new record, with prototype (NetWebServerWorker p_web). I receive "Page Not Found" error, What must one do to fix?

You can call a source procedure, with that prototype - that's perfectly ok (and I do it myself) but _how_ you call it is important.

First - you can't call a course, or a NetWebSource as a "page". In other words it won't be called directly as the "Procedure" or "URL" of a button etc. You can call it from source code.

The correct place to embed code for a button is in the validate::fieldname  routine. (This is where the "server side code" button goes).
You could place a call to your source procedure here.

Cheers
Bruce
Title: Re: Edit in Place example(s)
Post by: astahl on December 23, 2013, 04:08:48 AM
Hi Bruce,

Thank you very much! I think I have got what I need now.


Regards,

Ashley