Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Button

Locked
painatal
Posts: 12
Joined: Fri Mar 01, 2013 2:57 am

Button

Unread post by painatal »

Is it possible to create a button on a form or on a browse screen that redirects to another page? Also I want to pass a parameter from the form or line selectected into that page.
How can i do that.

Thanks
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Button

Unread post by massiws »

Painatal,
painatal wrote:Is it possible to create a button on a form or on a browse screen that redirects to another page?
Is the another page a new form or another external script?
- To create a button on a browse screen: http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs
- To create a button on edit screen you have to create a button object: http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs
- To run some external PHP code: http://wiki.nubuilder.com/tiki-index.ph ... nIt_pCode_
painatal wrote:Also I want to pass a parameter from the form or line selectected into that page.
You have different ways, depending on the job to do (the another page to open), but in all cases you have to use Javascript (and/or PHP):
- insert window.open() function in On Double Click object field, in All tab;
- in Javascript to run field in form Extra Action Buttons tab, you can insert some JS to retrive prm parameter and execute runIt(pCode,prm) function.

If you give us more informations we can try to better help you.

Max
painatal
Posts: 12
Joined: Fri Mar 01, 2013 2:57 am

Re: Button

Unread post by painatal »

Thank you for your answer.

I want a user to be able do download the info he wants as an example imagine you have this on a browse screen.

ID | Name | .... | Download
1 | test |.....| "Button to Download this info"

I can create the file if i get the info or the ID since i can get the rest of the fields from the ID, what I don't know is how to create a button to pass that parameter to the php script that creates the file.

I'll check those links you posted and see if they help.
Thanks
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Button

Unread post by massiws »

painatal,
painatal wrote:I want a user to be able do download the info he wants as an example imagine you have this on a browse screen.

ID | Name | .... | Download
1 | test |.....| "Button to Download this info"
buttons can be positioned only on Edit Screen.
painatal wrote: what I don't know is how to create a button to pass that parameter to the php script that creates the file.
One solution:
- on browse form: ID | Name | .... (no download buttons here);
- click the record you want to open an edit form;
- on this edit form you put a button object with this code in On Double Click field:

Code: Select all

var p1 = $('#ID').val();
runIt('script_name', p1);
- in Setup > Add Activities insert a new record with name script_name and this PHP code in Procedure tab:

Code: Select all

$id = '#runIt1#';
... your code ...
Hope this helps.
Max
painatal
Posts: 12
Joined: Fri Mar 01, 2013 2:57 am

Re: Button

Unread post by painatal »

Yep that should do the trick. Thank you
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Button

Unread post by admin »

.
Locked