Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By nikidinsey
#789825
Another question I've tried looking for an answer without luck.

If I create a Panel in a Dynaform with simply the following:

@@PupilFirstName

And nothing else, the output resolves correctly: Bill

However, if I add _any_ other characters at all to the panel, the variable doesn't resolve

@@PupilFirstName @@PupilLastName

Simply outputs: @@PupilFirstName @@PupilLastName (i.e. doens't resolve to the variable value).

My question:

How do I use @@variables in Panel? I would like to build some descriptive HTML using the variables added so far during a case.

Eg.

<h1>Pupil Work Experience Request from @@PupilFirstName @@PupilLastName</h1>
<p>Please spend sometime reviewing this request for @@PupilFirstName to work at @@EmployerName.</p>

Thanks a lot!

Niki
User avatar
By amosbatto
#789830
Create a trigger which is set to fire before the DynaForm and contains the following code:
Code: Select all
@@panelContent = "<h1>Pupil Work Experience Request from ".@@PupilFirstName." ".@@PupilLastName."</h1>\n".
   "<p>Please spend sometime reviewing this request for ".@@PupilFirstName." to work at ".@@EmployerName.".</p>";
Then use @@panelContent as the variable in your panel control.
User avatar
By amosbatto
#789877
marcosfpa wrote:How do I bind a @@ panelContent variable to the control panel? I did not make it...
It should work automatically. I wonder if your trigger has an error that prevents the setting of the variable. You can check in the debugger.

Another way to do the same thing is create a hidden field which is associated with the variable which you set in the trigger. Then add the following JavaScript code to your DynaForm:
Code: Select all
$("#myPanel").html( $("#myHidden").getValue() ); 
Where "myHidden" is the name of the variable you set in the the trigger and the ID of your hidden field and "myPanel" is the ID of the panel.

Edit: I switched "myPanel" and "myHidden".
By marcosfpa
#789909
It worked! And I found this very interesting. I would be correct in saying that this feature I could use to show the summary of the formatted process rather than simply include a read-only dynaform, since this is not very flexible in terms of configuring the view, very spaced fields, default font etc. ...?
User avatar
By amosbatto
#789915
Yes, you can include any information you want in a panel including a whole DynaForm, but no data entered in a panel will automatically be saved, so you have to create a trigger to handle the data, so it gets saved to case variables.
Designer not loading...

Okay after many, many, MANY hours.... I found […]

The Drip casino clone script enables entrepreneurs[…]

Create a cutting-edge crypto sports betting platfo[…]

Betdaq Clone Script is a ready-to-launch solution […]