Check the render method of `DrawerViewBase` - react-native

i try create side navBar and i get error:
My code:
This is the error i get

Related

Display red screen error in react native from a native module

I implemented a native module and I would like to display an error for a developer using the redbox error screen from the native module. This error will inform about obsolete values.
Does anyone know, how to display this kind of screen with a custom message?
Below I am attaching a screenshot, what I would like to achieve:
On android you can achieve this with the following code:
val exceptionManager = reactContext.getNativeModule(ExceptionsManagerModule::class.java)
val error: WritableMap = WritableNativeMap()
error.putString("message", "Error message")
exceptionManager.reportException(error)
on iOS it's also quite straightforward:
let exceptionsManager = bridge.module(forName: "RCTExceptionsManager") as? exceptionsManager
exceptionsManager?.reportFatalException("message", stack: nil, exceptionId: 1)

Mouseover not working on image_tag

I want to show a different image on the mouse over event.
This is the code I have (haml):
= image_tag(product.photos.first.asset.thumb.url, :onMouseover=> "this.src=product.photos.second.asset.thumb.url'", :onMouseout=> "this.src=product.photos.first.asset.thumb.url'")
but I keep getting "Uncaught SyntaxError: Unexpected token ILLEGAL" on that line.
Any suggestions of what am I doing wrong? thanks!
This was the solution:
= image_tag(product.photos.first.asset.thumb.url, :onMouseover=> "this.src='#{product.photos.second.asset.thumb.url}'", :onMouseout=> "this.src='#{product.photos.first.asset.thumb.url}'")

Set message inside the add dialog in jqgrid if error occurs

I am returning the following from my action (asp mvc) if error occurs upon adding the record to jqgrid
return new HttpStatusCodeResult(400, "item not found");
It's all great but the message displayed inside the add dialog is
"error Status: 'Workorder not found'. Error code: 400"
Is there any way to just show the "Item not found" message only?
It looks like the js never goes to afterSubmit routine in add options. Any way to gain the control and make sure that only the actual error message shows? Something like onError option would be great!
You can use errorTextFormat callback of form editing or jqGridAddEditErrorTextFormat event of jqGrid to control the format of the text from the error message. The first parameter of errorTextFormat callback (or the second parameter of jqGridAddEditErrorTextFormat) is jqXHR Object which is superset of XMLHttpRequest. The responseText property of the parameter is the text of the response body.
Moreover you should not use HttpStatusCodeResult for error description. Instead of that you should place the error description in the body of HTTP response. You can use WebFaultException for example to do this:
return throw new WebFaultException<string> (
"item not found",
HttpStatusCode.BadRequest); // 400
By the way the HTTP status code 404 (HttpStatusCode.NotFound) seems me more corresponds to the error "item not found".

Uncaught TypeError: Cannot call method 'getMonth' of null with dijit.form.DateTextBox

I have a grid and an editor for editing each row values. In my editor, i have a this dijit.form.DateTextBox. I also have submit and cancel button.
On Edit button click, I open the grid popup editor, which has 1 form and bunch of other dojo controls including text box. Now I want to use the cancel button to Reset the form and hide the Dojo Grid Popup Dialog. I created a function for the same. It works fine when i remove the JavaScript which runs after DateTextBox onChange event.
It gives me this below error.
Uncaught TypeError: Cannot call method 'getMonth' of null
The JavaScript I have on DateTextBox onChange event is this.
dojo.connect(dijit.byId("Edit_TrialStartDate"), "onChange", function () {
var item = dojo.date.locale.format(dijit.byId("Edit_TrialStartDate").value, { datePattern: "MM/dd/yyyy", selector: "date" });
dijit.byId("Edit_tTrialStartDate").setValue(item);
});
Because if this error, my grid popup dialog never releases the ID it is registered with. So I can only edit 1 record at a time. When I click on another row Edit button I get this below error.
Uncaught Error: Tried to register widget with id==TrialGridPopUp but that id is already registered
Does anyone have any idea how to resolve this?
Somewhere in your code you are passing an object that is not a date into a method that is expecting a date.
Uncaught TypeError: Cannot call method 'getMonth' of null
I would verify that dijit.byId("Edit_TrialStartDate").value is giving you a date object.
It's also better practice to call dijit.byId("Edit_TrialStartDate").get('value');

Fsockopen error handling, at the moment I get warnings and page stops further content from loading

I have the following code:
$open_socket = fsockopen($host,$port,$errno,$errstr,30);
if(!$open_socket){
echo "$errstr ($errno)<br />".$nl;
}else{
fputs($open_socket,$xml);
while(!feof($open_socket)){
$line = fgets($open_socket,128);
$return_xml.= $line;
}
fclose($open_socket);
}
but if there is not connection I get the following message:
Warning: fsocket ......
the rest of the page is blank, basically how can I handle this where my page will continue and things will be displayed and just the error message is displayed and not the warning.
Thanks
You can supress warnings calling fsockopen
$open_socket = #fsockopen($host,$port,$errno,$errstr,30);