Page 1 of 1

Button

Posted: Fri Mar 08, 2013 5:20 pm
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

Re: Button

Posted: Sat Mar 09, 2013 3:24 pm
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

Re: Button

Posted: Sun Mar 10, 2013 4:38 pm
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

Re: Button

Posted: Mon Mar 11, 2013 11:28 pm
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

Re: Button

Posted: Tue Mar 12, 2013 12:42 am
by painatal
Yep that should do the trick. Thank you

Re: Button

Posted: Wed Mar 13, 2013 5:12 am
by admin
.