function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pierrepierre 

Passing information to the user: popup, dhtml, dynamic visualforce ?

Problem: I'm designing a nice powerful apex code or s-control, but it's manipulating the record and I need to update the user on what the code is doing. For instance, I need to tell him/her that the code is updating the opportunity stage because of so and so..

Now how can I send information back to the user?
1) I can send an email (apex email api) to the user: not the best solution
2) I can dynamically display a portion of the page with visualforce, but it looks very long and painful to develop, see http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage
3) I can display a popup in javascript, but only if I'm writing an s-control (can apex dyamically run javascript? )

In an ideal world, I could code in one-line a dynamic information popup with minimal features: disappearing after one click, automatic snapshot of the page included in the popup, easy control of the text message font and color, maybe some Flash toolkit (Flash in SFDC pages = admiration from the users), something easy to code...
mikefmikef
pierre:

Here is a link to the wiki explaining exactly what you want to do.

You want to use the actionSupport and actionStatus tags in Visualforce.

Good luck.
pierrepierre
That's the page I referred to in my solution 2) : too complex, all I want to do is something like
alert([my information message to the user]);
not spending hours creating a custom page with custom behavior.

Message Edited by pierre on 09-04-2008 11:54 AM
mikefmikef
Apex doesn't have a UI feature.
Other then displaying errors and stopping your process.

The Visualforce page is the way to go if you want user interaction.
And it's not that complicated, Visualforce is easier then sControls.
pierrepierre
I'll look into it, but I'm not convinced: the popup is one line in Javascript, can't be beaten.
jlojlo
It is possible to call an Apex webservice using the Ajax Toolkit: http://wiki.apexdevnet.com/index.php/HelloWorld2.html
 
That being said, Visualforce would be the preferred solution.
pierrepierre
True, an s-control can call Apex, but I can't call the s-control from - for instance - the 'save' button as with Apex, and Apex can't call an s-control.