just been using my mobile UI on iOS (& local Mac Safari) in a pilot and got the following error if an invalid value is entered into a field
- Code: Select all
2012-03-09 12:19 http-8080-6 ERROR com.servoy.j2db.util.Debug Error rendering the page esw_stock_item_usage 9E221F6D-F7B2-4BC1-A219-0D00927BC442 eStockWeb
org.apache.wicket.WicketRuntimeException: Exception in rendering component: TEXT_FIELD[name:esw_patient,x:5,y:165,width:300,height:80,value:]
at org.apache.wicket.Component.renderComponent(Component.java:2764)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1559)
at com.servoy.j2db.server.headlessclient.dataui.WebDataField.onRender(WebDataField.java:466)
at org.apache.wicket.Component.render(Component.java:2525)
at org.apache.wicket.Component.renderComponent(Component.java:2666)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:876)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:680)
at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:590)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at com.servoy.j2db.server.headlessclient.WebClientsApplication$5.respond(WebClientsApplication.java:411)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1287)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at com.servoy.j2db.server.servlets.Zl.doGet(Zl.java:9)
at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:160)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NullPointerException
at com.servoy.j2db.server.headlessclient.dataui.FocusIfInvalidAttributeModifier$1.getObject(FocusIfInvalidAttributeModifier.java:55)
at com.servoy.j2db.server.headlessclient.dataui.FocusIfInvalidAttributeModifier$1.getObject(FocusIfInvalidAttributeModifier.java:1)
at org.apache.wicket.model.Model.getObject(Model.java:1)
at org.apache.wicket.AttributeModifier.getReplacementOrNull(AttributeModifier.java:378)
at org.apache.wicket.AttributeModifier.replaceAttributeValue(AttributeModifier.java:280)
at org.apache.wicket.AttributeModifier.onComponentTag(AttributeModifier.java:243)
at org.apache.wicket.Component.renderComponentTag(Component.java:4305)
at org.apache.wicket.Component.renderComponent(Component.java:2716)
... 31 more
The field in question (esw_patient) is a global text field that the user is meant to enter a patient number into (either by typing or scanning a bar code)
I have an onDataChange method attached to it (the patient number can be either an NHS no, or a hospital no)
[the relationships are based on the globals.esw_patient to either of the above numbers]
- Code: Select all
function onDataChangePT ( oldValue, newValue, event )
{
var $pt_name = '';
try
{
if ( databaseManager.hasRecords ( esw_to_patients_nhs_no ) )
{
globals.esw_patient_id = esw_to_patients_nhs_no.id_patient ;
$pt_name = esw_to_patients_nhs_no.forename_1st + ' ' + esw_to_patients_nhs_no.surname ;
}
else if ( databaseManager.hasRecords ( esw_to_patients_rm_pt_no ) )
{
globals.esw_patient_id = esw_to_patients_rm_pt_no.id_patient ;
$pt_name = esw_to_patients_rm_pt_no.forename_1st + ' ' + esw_to_patients_rm_pt_no.surname;
}
else
{
//no match error on pt'
globals.esw_patient = oldValue ;
elements.esw_patient.requestFocus() ;
return false;
}
if ( $pt_name != '' )
{
checkRequired ( );
return true;
}
else
return false;
}
catch(e)
{
globals.esw_error_msg = 'Error ' + e ;
}
}
The error only gets thrown if there isn't a match on the patient and doesn't always happen (i.e. sometimes my code correctly highlights same box in red putting original value back in), but it has happened on iOS & Mac (both using webkit browsers)
Under normal (i.e. not test/pilot) usage, the patient number should always be found if scanning, but if user is entering by hand and enters an incorrect value, there might not be a match.
Please can anyone advise me what is going wrong, as when system goes live (hopefully in a couple of weeks ), we can't have the solution crashing out...
[One more thing, the overall system is running in the Servoy Framework by Sanneke, which handles the login to solution, but as soon as they go into it, I check if they are running web client and if so switch them to my mobile UI in a module 'eStockWeb' which is why things are prefixed by esw)
Thanks
Rafi
[Servoy 6.0.5]