cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pironio
Level 3

How do I get getISHtmlControl , getISFrame(), getISPanel() from a WizardBeanEvent eve

How do I get getISHtmlControl , getISFrame(), getISPanel() from a WizardBeanEvent event
Labels (1)
0 Kudos
(8) Replies
rmackay
Level 7

pironio wrote:
How do I get getISHtmlControl , getISFrame(), getISPanel() from a WizardBeanEvent event



What type of event? Are you in the panel source when you are trying to do this?
0 Kudos
pironio
Level 3

I AM HERE...
public class MyAction extends CancelableWizardAction {
public void execute(WizardBeanEvent event) {

RunnableWizardBeanState progress = this.getState();
int seconds = 5;
boolean completed=false;
// Update the progress bar every 1/10 second
int workUnits = seconds * 10;
final long sleepDuration = 100; // milliseconds

// reset the progress bar of the calling wizard action to 0%
progress.setPercentComplete(0);

try {
for (int i=1; i<=workUnits; i++) {
Thread.sleep(sleepDuration);
progress.setStatusDetail("Completed "+i+" of "+workUnits);
progress.setPercentComplete(100*i/workUnits);
while (progress.isSuspended()) {
// User clicked Cancel button, waiting for them to confirm
if (progress.isCanceled()) {
return; // Show next panel, do not exit wizard completely.


.......... THIS IS WHAT I NEED TO DO TO UPDATE THE HTML PANEL


ISPanel panel = event......getISPanel();
ISHtmlControl html = panel.getISHtmlControl("SystemStatusPreChecking_MachineStatus_Var");
html.setContentType(ISHtmlControl.HTML_CONTENT_TYPE);
StringBuffer sb = new StringBuffer();
............
html.setText(sb.toString());






}
0 Kudos
rmackay
Level 7

Unfortunately, I do not think that the WizardBeanEvent class will be able to get you to the getISPanel() method.

If you were writing this as a panel and you had access to the panel event methods you would have no problem. Why did you choose to do this as a WizardBeanEvent when you are showing a panel with a progress bar?
0 Kudos
pironio
Level 3

OK, I have a panel that works fine...when post status .only....
.. the problem is when I try to add a progress bar to that panel... the only way I know how to add a custom progress bar is by having the action I show you in previous posts....
public class ProgressBarAction extends AsynchronousWizardAction //CancelableWizardAction
{

I don't know how to add a customized progress bar inside the panel without a wizard action .... Is that possible? ....when I have a panel like this....


public class PanelSystemStatusPreChecking extends Thread
{
private com.installshield.event.ui.ISDialogContext context=null;

public void initializeUISystemStatusPreChecking(com.installshield.event.ui.ISDialogContext context)
{

end initializeUISystemStatusPreChecking

public void queryEnterSystemStatusPreChecking(com.installshield.event.ISQueryContext context)
{
}

public void enteredSystemStatusPreChecking(com.installshield.event.ui.ISDialogContext context)
{
try
{
if (context.getServices().getISDatabase().getVariableValue("AllFrames_LastButtonClicked").equals("next"))
{

ISFrame frame = context.getISFrame();
ISButton nextButton = frame.getButton("next");
//disable the next button
nextButton.setEnabled(true);
this.context=context;
ISButton backButton = frame.getButton("back");
backButton.setEnabled(true);
ISButton cancelButton = frame.getButton("cancel");
cancelButton.setEnabled(true);


//start thread
this.run();


}//end enteredSystemStatusPreChecking


public void run()
{
context.logEvent(this, Log.DBG, "run-Entry.");

try
{
//get status from the controller
updateMessage(controllerInstance.getControllerStatus());
//----- wait for all machines to finish...

//get status from the controller
updateMessage(controllerInstance.getControllerStatus());

......
0 Kudos
rmackay
Level 7

If you have things encapsulated inside a panel then it should be simple to grab the control IDs for the controls you need to access.

For example, this code would get you the handle for the control of a text field. (TEXT_CTRL_ID would be defined as whatever your actual control ID is)


ISTextField textfieldCtrl = (ISTextField)context.getISPanel().getControl(TEXT_CTRL_ID);


Once you grab the control ID, there are a whole lot of things you can do with it.
0 Kudos
pironio
Level 3

Yes, I have all that under control I can get getISFrame(), getISPanel() in the panel.... MY problem is How do I do a custom progress bar from within the panel..

progress.setStatusDetail("Completed "+i+" of "+workUnits);
progress.setPercentComplete(100*i/workUnits);


Having two threads,

public class MyAction extends CancelableWizardAction {
and ....
public class PanelSystemStatusPreChecking extends Thread

don't work, so if I have everything under panel control.. how do I set

progress.setPercentComplete(... ) from the run method in the panel?
0 Kudos
rmackay
Level 7

Ok I see what you are getting at. The built in progress controls dont seem to work the same way as the other controls in the panel. I basically abandoned using them in custom panels because I couldn't do what you are trying to do.
0 Kudos
pironio
Level 3

K, thanks for your quick response..
0 Kudos