Page 1 of 1

Servoy 6.0 release candidate 5

PostPosted: Fri Jul 22, 2011 11:39 am
by Jan Blok
We are pleased to announce the immediate availability of Servoy 6.0 release candidate 5.

This version is available through the download option on the Servoy website and auto update.
Always make a backup of your current Servoy installation (directory and database) before installing/upgrading.
To update a Servoy eclipse open Check for updates via help menu.

For all the highlights read the wiki.

Client Changes
[fix] application startup hangs when having multicolumn pk's on some databases
[fix] 401650 onRightClick problems with JSEvent in WC and SC

Developer Changes
[fix] 402229 Dropping media do not render when gif file type
[fix] 401127 Search for References on a method doesn't find locations where the method is used as a bgrowcolorCalc

Plugin Changes
[fix] 302282 spellchecker plugin issue

Re: Servoy 6.0 release candidate 5

PostPosted: Fri Jul 22, 2011 5:36 pm
by rossent
Hi Servoy,

The issue with warnings of overridden functions ("Function X hides another function" - case ID: 362968) which was fixed in 6.0 b2 appears again in RC5.

Do we need to mark now the overridden functions with a special JSDoc tag or is this a regression bug?

Re: Servoy 6.0 release candidate 5

PostPosted: Fri Jul 22, 2011 5:47 pm
by jcompagner
that is already fixed, it was a regression.

Re: Servoy 6.0 release candidate 5

PostPosted: Fri Jul 22, 2011 6:34 pm
by hsummerhays
When calling a prototype method, Servoy warns "The method xxxx in type xxx is not applicable for the arguments (xxx)" even if you use the object["method"]() notation instead of object.method().

Example using date_modjs module from servoyforge (two of these warnings are shown for the last line):
Code: Select all
// Note: start and end are Date objects defined earlier.

/** @type {String} */
var dateFormat = "yyyy-MM-dd HH:mm:ss";
/** @type {String} */
var searchDate = start["toString"](dateFormat) + "..." + end["toString"](dateFormat) + "|" + dateFormat;

Re: Servoy 6.0 release candidate 5

PostPosted: Mon Jul 25, 2011 4:53 pm
by jcompagner
so you did do an override of the toString method and now it must take a extra format param?

This kind of prototyping is currently not supported, even if you use the 'array' notation. Because that static notation still maps on a real thing so it will still try to match it for you
you can do it by using a variable so that it becomes completely dynamic:

Code: Select all
var start = new Date();
   var end = new Date();
   var method = "toString";
   /** @type {String} */
   var dateFormat = "yyyy-MM-dd HH:mm:ss";
   /** @type {String} */
   var searchDate = start[method](dateFormat) + "..." + end[method](dateFormat) + "|" + dateFormat;



but why "toString" why not just add a "format" function?

Re: Servoy 6.0 release candidate 5

PostPosted: Tue Jul 26, 2011 5:30 pm
by hsummerhays
Thanks for the solution Johan. The toString method for formatting dates is part of the Date.js open source code.

Re: Servoy 6.0 release candidate 5

PostPosted: Tue Jul 26, 2011 7:45 pm
by rossent
Hi Servoy,

After the update to RC4 or RC5 (not sure when exactly), we started to see the following errors in the server log:

Code: Select all
AWT-EventQueue-0    ERROR    com.servoy.j2db.util.Debug    No selection set on foundset with size 1 fs: FoundSet[Table:id_approver,Size: 1,CachedRecords: 1,SELECTED INDEX: -1]
java.lang.RuntimeException
     at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:47)
     at com.servoy.j2db.scripting.SelectedRecordScope.get(SelectedRecordScope.java:105)
     at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1641)
     at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1739)
     at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1678)
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3752)
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
     at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:518)
     at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:379)
     at com.servoy.j2db.FormController.executeFunction(FormController.java:4050)
     at com.servoy.j2db.FormController.executeFunction(FormController.java:3929)
     at com.servoy.j2db.FormController.executeFunction(FormController.java:3851)
     at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3706)
     at com.servoy.j2db.ui.RenderEventExecutor.fireOnRender(RenderEventExecutor.java:88)
     at com.servoy.j2db.smart.dataui.DataRenderer.fireDataRendererOnRender(DataRenderer.java:843)
     at com.servoy.j2db.smart.dataui.DataRenderer.getListCellRendererComponent(DataRenderer.java:540)
     at com.servoy.j2db.smart.RecordView.syncSliderAndRefresh(RecordView.java:224)
     at com.servoy.j2db.smart.RecordView.valueChanged(RecordView.java:333)
     at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
     at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
     at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
     at javax.swing.DefaultListSelectionModel.insertIndexInterval(Unknown Source)
     at com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel.insertIndexInterval(AlwaysRowSelectedSelectionModel.java:92)
     at com.servoy.j2db.util.model.AlwaysRowSelectedSelectionModel.intervalAdded(AlwaysRowSelectedSelectionModel.java:238)
     at com.servoy.j2db.dataprocessing.TableAndListEventDelegate.fireIntervalAdded(TableAndListEventDelegate.java:120)
     at com.servoy.j2db.dataprocessing.TableAndListEventDelegate$1.run(TableAndListEventDelegate.java:147)
     at com.servoy.j2db.dataprocessing.TableAndListEventDelegate.fireTableAndListEvent(TableAndListEventDelegate.java:175)
     at com.servoy.j2db.dataprocessing.SwingFoundSet.fireFoundSetEvent(SwingFoundSet.java:147)
     at com.servoy.j2db.dataprocessing.FoundSet.addRecord(FoundSet.java:3693)
     at com.servoy.j2db.dataprocessing.FoundSet.newRecord(FoundSet.java:3643)
     at com.servoy.j2db.dataprocessing.FoundSet.newRecord(FoundSet.java:3606)
     at com.servoy.j2db.FormController.newRecordImpl(FormController.java:2680)
     at com.servoy.j2db.FormController.access$7(FormController.java:2664)
     at com.servoy.j2db.FormController$JSForm.js_newRecord(FormController.java:1015)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:361)
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3134)
     at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:179)
     at org.mozilla.javascript.Context.evaluateString(Context.java:1233)
     at com.servoy.j2db.scripting.ScriptEngine.eval(ScriptEngine.java:573)
     at com.servoy.j2db.FormController.eval(FormController.java:3832)
     at com.servoy.j2db.smart.dataui.DataTextEditor$LinkListener.hyperlinkUpdate(DataTextEditor.java:875)
     at javax.swing.JEditorPane.fireHyperlinkUpdate(Unknown Source)
     at com.servoy.j2db.util.gui.FixedHTMLEditorKit$LinkController.activateLink(FixedHTMLEditorKit.java:683)
     at com.servoy.j2db.util.gui.FixedHTMLEditorKit$LinkController.mouseClicked(FixedHTMLEditorKit.java:488)
     at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
     at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Container.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.awt.EventQueue.access$000(Unknown Source)
     at java.awt.EventQueue$1.run(Unknown Source)
     at java.awt.EventQueue$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
     at java.awt.EventQueue$2.run(Unknown Source)
     at java.awt.EventQueue$2.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)


A while ago, there was an issue related to the foundset to having a current record selected after loading or modifying data. Looking at the error message, it appears that this issue is something similar. We are not seeing an error in the application so not sure what causes the error to show up in the server log. I suspect that in our code we are using something like:

Code: Select all
    var _record = foundset.getSelectedRecord();

    if(_record)
    {
        ...
    }


The code will not "break" in this case since it checks if the foundset.getSelectedRecord() returns a result, but obviously the end result will not be correct. In my opinion, if a foundset contains any records, it should always have at least 1 record selected.

Re: Servoy 6.0 release candidate 5

PostPosted: Wed Jul 27, 2011 10:18 am
by jcompagner
rossen,

this is some kind of state that shouldn't really happen yes, it would be nice to know how you get that foundset in that state.
The good thing is that it won't affect you at all, and the record will not be null..

Code: Select all
      if (selectedIndex == -1 && fc.getFormModel().getSize() > 0)
      {
         Debug.error("No selection set on foundset with size " + fc.getFormModel().getSize() + " fs: " + fc.getFormModel(), new RuntimeException());
         fc.getFormModel().setSelectedIndex(0);
      }


as you can see if we detect this state, we log it so we know that it did happen, and then we set the selection to the first record.
(which will be returned then)

So from your code, the flow is normal, but yes somehow the foundset is in a wrong state, how that happens we would like to know.

Re: Servoy 6.0 release candidate 5

PostPosted: Thu Jul 28, 2011 10:58 am
by Jan Blok
rossent wrote:java.lang.RuntimeException
at com.servoy.j2db.scripting.SelectedRecordScope.getSelectedRecord(SelectedRecordScope.java:47)

The problem is found and addressed, but we missed the Servoy 6.0 release window.
Its an internal warning for unexpected selection state, it will not affect the working of your solution.