WindowBuilder Unable to load *.wbp-component.xml description - windowbuilder

I've installed the last version (1.9.7) of WindowBuilder.
When i create the "Application Window" i receive the following error
Unable to load *.wbp-component.xml description.
does anyone know the problem and how to fix it?
Thank you.

I'm having the same problem. Everything was fine until recently when I switched from windows 7 to windows 10 (not sure if it makes a difference but who knows). I'm kinda newbie in all of this, but I thought it might help if I showed the stack trace. Personally I think the problem might be with the java path if that makes any sense. I remember that I did something when I installed for the first time (university, professor showed us what to do, but I can't remember what it was (some kind of pathing)).
org.eclipse.wb.internal.core.utils.exception.DesignerException: 502 (Unable to load *.wbp-component.xml description.). javax.swing.JFrame
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:442)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:289)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription(ComponentDescriptionHelper.java:258)
at org.eclipse.wb.internal.core.model.JavaInfoUtils.createJavaInfo(JavaInfoUtils.java:387)
at org.eclipse.wb.internal.swing.parser.ParseFactory.getRootContext(ParseFactory.java:128)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.prepareParseContext(JavaInfoParser.java:1182)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:242)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.access$9(JavaInfoParser.java:238)
at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:153)
at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:1)
at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:159)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:151)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:534)
at org.eclipse.wb.internal.core.editor.DesignPage.access$9(DesignPage.java:522)
at org.eclipse.wb.internal.core.editor.DesignPage$8$1.run(DesignPage.java:449)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4779)
at org.eclipse.wb.internal.core.editor.DesignPage$8.run(DesignPage.java:446)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:468)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF_withProgress(DesignPage.java:465)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:415)
at org.eclipse.wb.internal.core.editor.UndoManager.refreshDesignerEditor(UndoManager.java:381)
at org.eclipse.wb.internal.core.editor.DesignPage.refreshGEF(DesignPage.java:392)
at org.eclipse.wb.internal.core.editor.actions.RefreshAction.run(RefreshAction.java:46)
at org.eclipse.wb.internal.core.editor.actions.DesignPageAction.run(DesignPageAction.java:34)
at org.eclipse.wb.internal.core.editor.errors.JavaExceptionComposite.doRefresh(JavaExceptionComposite.java:87)
at org.eclipse.wb.internal.core.editor.errors.ExceptionComposite$3.widgetSelected(ExceptionComposite.java:129)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4243)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4060)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3632)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by:
java.lang.reflect.InaccessibleObjectException: Unable to make protected java.lang.String javax.swing.JFrame.paramString() accessible: module java.desktop does not "opens javax.swing" to unnamed module #38c6f088
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.appendPropertyComponents(ReflectionUtils.java:1560)
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.getPropertyDescriptors(ReflectionUtils.java:1469)
at org.eclipse.wb.internal.core.model.description.rules.StandardBeanPropertiesRule.begin(StandardBeanPropertiesRule.java:47)
at org.apache.commons.digester.Digester.startElement(Digester.java:1563)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1387)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:389)
... 56 more
Full context stack trace:
org.eclipse.wb.internal.core.utils.exception.DesignerException: 502 (Unable to load *.wbp-component.xml description.). javax.swing.JFrame
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:442)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:289)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription(ComponentDescriptionHelper.java:258)
at org.eclipse.wb.internal.core.model.JavaInfoUtils.createJavaInfo(JavaInfoUtils.java:387)
at org.eclipse.wb.internal.swing.parser.ParseFactory.getRootContext(ParseFactory.java:128)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.prepareParseContext(JavaInfoParser.java:1182)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:242)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.access$9(JavaInfoParser.java:238)
at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:153)
at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:1)
at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:159)
at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:151)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:534)
at org.eclipse.wb.internal.core.editor.DesignPage.access$9(DesignPage.java:522)
at org.eclipse.wb.internal.core.editor.DesignPage$8$1.run(DesignPage.java:449)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4779)
at org.eclipse.wb.internal.core.editor.DesignPage$8.run(DesignPage.java:446)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:468)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF_withProgress(DesignPage.java:465)
at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:415)
at org.eclipse.wb.internal.core.editor.UndoManager.refreshDesignerEditor(UndoManager.java:381)
at org.eclipse.wb.internal.core.editor.DesignPage.refreshGEF(DesignPage.java:392)
at org.eclipse.wb.internal.core.editor.actions.RefreshAction.run(RefreshAction.java:46)
at org.eclipse.wb.internal.core.editor.actions.DesignPageAction.run(DesignPageAction.java:34)
at org.eclipse.wb.internal.core.editor.errors.JavaExceptionComposite.doRefresh(JavaExceptionComposite.java:87)
at org.eclipse.wb.internal.core.editor.errors.ExceptionComposite$3.widgetSelected(ExceptionComposite.java:129)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4243)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4060)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3632)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by:
java.lang.reflect.InaccessibleObjectException: Unable to make protected java.lang.String javax.swing.JFrame.paramString() accessible: module java.desktop does not "opens javax.swing" to unnamed module #38c6f088
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.appendPropertyComponents(ReflectionUtils.java:1560)
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.getPropertyDescriptors(ReflectionUtils.java:1469)
at org.eclipse.wb.internal.core.model.description.rules.StandardBeanPropertiesRule.begin(StandardBeanPropertiesRule.java:47)
at org.apache.commons.digester.Digester.startElement(Digester.java:1563)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1387)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.eclipse.wb.internal.core.model.description.helpers.ComponentDescriptionHelper.getDescription0(ComponentDescriptionHelper.java:389)
... 56 more
The code itself doesn't matter, it's same for everything, every time, same error, used codes that worked on my friends PC.
I hope I attached the image correctly.
Thanks on any help :)
If I find the solution, I will post it here :D
image here

Related

testcafé: An error occurred when trying to calculate a custom Selector property

I'm using Testcafe and I have pretty straightforward selector:
const tile = Selector('[data-component="tile"]');
And that selector is used to create this:
const titleFieldTile = tile.nth(0);
const titleFieldName = titleFieldTile.find(
'[data-testid="tile-content"] [data-testid="ps-field-form-name"]'
);
This is defined outside of the test, and in the test this line causes the test to fail:
await t
.expect(titleFieldType.textContent)
.eql('text')
Giving this error:
1) An error occurred when trying to calculate a custom Selector property "header":
ReferenceError: _ref is not defined
Browser: Chrome 90.0.4430.93 / macOS 10.15.7
...
58 | await t
59 | // .expect(titleFieldType.textContent)
60 | // .eql('text')
61 | .expect(titleFieldName.textContent)
> 62 | .eql('TITLE')
If I console.log the titleFieldName that works, it is the camparison that is causing problems, but I can't figure out why.
I have no custom DOM or methods added to the selector, so I'm not sure where the error is coming from.
Just to be clear, I've created these types of Selectors a lot, and never had a problem.
I've narrowed it down a bit. The .textContent is causing the problem.
I managed to work around this doing this:
await t
.expect(titleFieldType.withText('text').exists)
.ok()
.expect(titleFieldName.withText('TITLE').exists)
.ok()
Basically filtered for the text (can be a regular expression) and then checked if anything actually matched.
It does what I need.

Running MagicZoomPlus.stop(); causes intermittent errors

If I call MagicZoomPlus.stop(); on active magiczooms I'll frequently get the error:
Uncaught TypeError: Cannot read property 'width' of null
At other times I'll get this error:
Uncaught TypeError: Cannot read property 'r' of undefined
When that happens, mousing over the thumbnails triggers:
Uncaught TypeError: Cannot read property 't16' of null
I've tried ...
calling MagicZoomPlus.stop() within the onload event
calling MagicZoomPlus.stop() within a setTimeout of different lengths
calling MagicZoomPlus.stop() after testing for the presence of MagicZoomPlus
testing an image for width/height before calling MagicZoomPlus.stop()
setting width/height on images via css and attributes before calling MagicZoomPlus.stop()
Here's a link to a jsfiddle that uses markup copied from an example on their docs page:
http://jsfiddle.net/sjjju4x4/6/
If you 'run' the fiddle with the console open you'll sometimes get the error, sometimes not. If you reduce the timeout to 10 ms it'll happen more often
Seems like I can't post without a code sample, so here's the JS from the fiddle:
var output = document.getElementById('status');
setTimeout(function () {
document.getElementById('status').textContent = '...............calling stop';
MagicZoomPlus.stop();
}, 20);
Thanks in advance for any help or suggestions you can provide.
Please make sure that the MagicZoom instance is ready before calling MagicZoomPlus.stop().
It is possible to do this with the “onready” callback described at this URL below:
https://www.magictoolbox.com/magiczoomplus/integration/#api
Here is some sample code:
MagicZoomPlus.options = {
'onready': function(id, isUpdated) {
setTimeout(function () {
document.getElementById('status').textContent = '...............calling stop';
MagicZoomPlus.stop(id);
}, 20);
}
};
Here is a jsfiddle to help you see the code:
http://jsfiddle.net/pg9f98z0/

RX threadding issues in WinRT

I have some simple code:
var timer = Observable.Timer(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)).Timestamp();
//timer.Subscribe(x => timerTb.Text = x.Value.ToString());
timer.Subscribe(x => Debug.WriteLine(x.Value));
And a textbox on the view called timerTb. I am trying to get the commented out line to work without it shouting about marshalling issues.
From what i can find out i should be using timer.ObserveOnDispatcher().Subscribe(...
But i do not have access to this method, nor do i have access to the CoreDispatcherScheduler dispite referencing "System.Reactive.Linq;"
I am running RX 2.0.20304.0
Any ideas?
I managed to get it working.
Silly rookie mistake CoreDispatcherScheduler was in : System.Reactive.Windows.Threading
Once i referenced that i got ObserveOnDispatcher() and this worked:
var timer = Observable.Timer(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)).Timestamp();
timer.ObserveOnDispatcher().Subscribe(x => timerTb.Text = x.Value.ToString());
Put your timer on the UI thread:
Observable.Timer(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1), CoreDispatcherScheduler.Instance)
.Timestamp();

Grails 2.0.4 webflow "type mismatch" exception

I'm still pretty new to Grails and I'm developing an online survey. I decided to use web flow and I have been running into many issues. I'm trying to pass the survey id from the gsp page to the flow controller. This works perfectly fine on any other controller action but whenever I do it to the action for the start state of the flow I always get the same error. I've followed a tutorial in a text book that does this the EXACT same way and I'm running out of ideas.
here is the link from the gsp page:
<g:link controller="surveyPage" action="beginTest" id="${survey.id}">
${survey.surveyName}
</g:link>
and here is the flow with the start state
def beginTestFlow = {
showSurvey{
def survey = Survey.get(params.id)
on("cancel").to "cancelSurvey"
on("continueSurvey").to "nextQuestion"
}
cancelSurvey { redirect(controller:"surveyPage") }
}
it always throws the exception:
argument type mismatch on the line with
def survey = Survey.get(params.id)
I've also tried:
flow.survey = Survey.get(params.id)
or even:
flow.survey = Survey.get(session.survey.id)
always the same error. Also, I made sure class Survey implements Serializable. I've copied and pasted the same code into a different action with the same controller and it works flawlessly. Any ideas to what is different with the web flow?
You can't put code like that directly inside a state definition, you need to use an action state or an onEntry block
def beginTestFlow = {
showSurvey{
onEntry {
flow.survey = Survey.get(params.id)
}
on("cancel").to "cancelSurvey"
on("continueSurvey").to "nextQuestion"
}
cancelSurvey { redirect(controller:"surveyPage") }
}
The onEntry block will fire every time the showSurvey state is entered. If instead you want some logic to be run just once at the start of the whole flow (for example if some later transition might re-enter the initial state), you can use a flow-level onStart block instead:
def beginTestFlow = {
onStart {
flow.survey = Survey.get(params.id)
}
showSurvey{
on("cancel").to "cancelSurvey"
// ...
Ivo Houbrechts wrote an excelent tutorial about grails 2.0 webflow. You can read it here:
http://livesnippets.cloudfoundry.com/docs/guide/

try statement tripping debugger (as3)

Trying a try-catch sequence that works fine in release version, but running it in debugger causes errors to be displayed. Obviously there errors, that's why I'm using this stuff inside try, but I'm wondering if there's any way I can get debugger to stop stopping. While I don't even mind the error message, the app no longer executes properly.
I've got a this[$val] that I needs to return a null if there is no such variable inside the class.
try {
return this[$val]+"";
} catch(error:ArgumentError) {
// Do nothing
}
return "";
again, this works like it is supposed to, but it causes errors in debugger
any ideas for an alternative?
I think you are catchin an argument error in place of the real problem of handling a null object + string error.Try Using;:
try {
return this[$val]+"";
} catch(error:Error) {
// Do nothing
}
return "";