Open a popup window with bonita form fields

1
0
-1

Hello!

I would like to know ( If this is possible in Bonita SP ) how to implement a form that have two link buttons:

  • Link A: Opens a popup window and show some formatting (htrml/css) fields from the instance process to be printed.
  • Link B: Submit the form(next step)

Any ideas will be welcomed.

Thanks in advance,

Fabiana

Comments

Submitted by ttoine on Thu, 11/21/2013 - 15:50

Hello, do you need to use links for that, or you can use submit buttons ?

3 answers

1
+4
-1

Hello,

You can follow those steps :

  1. Create a form,
  2. on the submit button set "submitPrint" in the class input field in Appearance tab> Field> Custom style
  3. in this form put a new html widget after the submit button
  4. Click on data tab
  5. put in initial value this javascript code

<script type="text/javascript">document.getElementsByClassName("submitPrint")[0].onclick=function(){<br />
                /*<br />
                * this example prints the whole window by click on submit button,<br />
                * you can format data as you want by adding style, text then print.<br />
                * You can do it by many ways, you can also retrieve data from fields
        * then print its in a new popup opened through javascript<br />
                *<br />
                */<br />
                window.print(); // this will print the whole window
          var retrieved_values = "fdsf";//get your fields value<br />
        <br />
                  var myWindow = window.open("","MsgWindow","width=200,height=100");//open a new popup<br />
                  myWindow.document.write("<p>"+retrieved_values+"</p>");//print your popup<br />
        };
</script>

Comments

Submitted by Fabiana on Thu, 01/16/2014 - 17:25

Nicolas,

Thank you very much!

It worked!

Best Regards,
Fabiana

1
0
-1

Hello!

Ttoine: I can use "submit" buttons! I tried with the following widget:

  • Widget > Submit
  • Appearence - Cell > Button style option: Label
  • General - Options > HTML Attributes:
  • But I don't know how to open the "window.print()" result in a new window or maybe, if exists, maybe I can use some code to send the form to the printer without opens a window and after goes to the next step.

Nicolas: please, can you send me some code example, or something like that? Or as I explained above, can be just some code to send the form directly to the spool service to print the data and go to the next step!

Thank you for your kindness!

Fabiana

1
0
-1

you can add a javascript event listener on the link that displays an hidden fieldset which contains your data. Then you can apply some css rules to render as a popup.

Comments

Submitted by Fabiana on Thu, 06/09/2016 - 21:10

Hello!

My idea was send some fields to printer directly without a user interference, because he can't interfer in this print process like cancel it.

Thank you for all your help!

Fabiana

Notifications