Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hello all!
Trying to change the name of the dialog box. To display the window I use the UIShowMessageDialog method. If its second parameter is null, then the window name is "Info". I use MessageDialogOptions.SetDialogLabel to set my value. Implemented the interface, and its void method is SetDialogLabel.
The IDE throws the following error:
The method UIShowMessageDialog (String, MessageDialogOptions) in the type Session is not applicable for the arguments (String, void).
My code:
import com.ptc.cipjava.jxthrowable;
import com.ptc.pfc.pfcSession.Session;
import com.ptc.pfc.pfcSession.CreoCompatibility;
import com.ptc.pfc.pfcSession.pfcSession;
import com.ptc.pfc.pfcUI.MessageButton;
import com.ptc.pfc.pfcUI.MessageButtons;
import com.ptc.pfc.pfcUI.MessageDialogOptions;
import com.ptc.pfc.pfcUI.MessageDialogType;
public class TestApp {
public static void start() throws jxthrowable{
Session curSession = pfcSession.GetCurrentSessionWithCompatibility(CreoCompatibility.C4Compatible);
MessageDialogOptions h = new SetDL();
curSession.UIShowMessageDialog("Hello!", h.SetDialogLabel("my title"));
}
public static void stop() throws jxthrowable{
Session curSession = pfcSession.GetCurrentSessionWithCompatibility(CreoCompatibility.C4Compatible);
curSession.UIShowMessageDialog("Goodbye!", null);
}
class SetDL implements MessageDialogOptions{
@Override
public void xdelete() throws jxthrowable {
// TODO Auto-generated method stub
}
@Override
public long getptr() {
// TODO Auto-generated method stub
return 0;
}
@Override
public MessageButtons GetButtons() throws jxthrowable {
// TODO Auto-generated method stub
return null;
}
@Override
public MessageButton GetDefaultButton() throws jxthrowable {
// TODO Auto-generated method stub
return null;
}
@Override
public MessageDialogType GetMessageDialogType() throws jxthrowable {
// TODO Auto-generated method stub
return null;
}
@Override
public void SetButtons(MessageButtons arg0) throws jxthrowable {
// TODO Auto-generated method stub
}
@Override
public void SetDefaultButton(MessageButton arg0) throws jxthrowable {
// TODO Auto-generated method stub
}
@Override
public void SetDialogLabel(String arg0) throws jxthrowable {
// TODO Auto-generated method stub
System.out.println(arg0);
}
@Override
public void SetMessageDialogType(MessageDialogType arg0) throws jxthrowable {
// TODO Auto-generated method stub
}
@Override
public String GetDialogLabel() throws jxthrowable {
// TODO Auto-generated method stub
return null;
}
}
Help me please to solve this problem.
Best Regards!
Solved! Go to Solution.
Hi,
I modified my install_test_05.zip created yesterday 🙂
I added following lines
import com.ptc.pfc.pfcUI.*;
...
MessageDialogOptions mdo;
...
mdo = pfcUI.MessageDialogOptions_Create();
mdo.SetDialogLabel("MyTitle");
proeSession.UIShowMessageDialog(flist, mdo);
INFO:
I started loadApiWizard.html and searched for UIShowMessageDialog
I realized that second argument is ... MessageDialogOptions
I followed link Session Objects: Writing a Message Using a Message Pop-up Dialog Box and read information about UIShowMessageDialog method
I followed link MessageDialogOptions and read information how to define my own title.
Hi,
I modified my install_test_05.zip created yesterday 🙂
I added following lines
import com.ptc.pfc.pfcUI.*;
...
MessageDialogOptions mdo;
...
mdo = pfcUI.MessageDialogOptions_Create();
mdo.SetDialogLabel("MyTitle");
proeSession.UIShowMessageDialog(flist, mdo);
INFO:
I started loadApiWizard.html and searched for UIShowMessageDialog
I realized that second argument is ... MessageDialogOptions
I followed link Session Objects: Writing a Message Using a Message Pop-up Dialog Box and read information about UIShowMessageDialog method
I followed link MessageDialogOptions and read information how to define my own title.
Thank you so much!
Yes, thanks for the help. But I did the same steps that you indicated before writing. But a couple of small mistakes did not allow me to get the result.