0

Clarification regarding BrowserPlus HandleID

Hi,

When and where the BrowserPlus HandlerID used?

Here is my usecase:

Use Case1) I'm getting the file object through FileBrowse Service, and altering the image with new width and height. Storing the same file object to another variable. Clicking on another button getting the file object stored on the private variable and doing the alteration. I'm able to do this scenario.

Use Case2) Passing the file object to another window and able to retrieve the browser plus file object. Creating the instance of $BP and passing the retrieved file object to ImageAlter service. Here am getting "failed to modify image: bpPlugin.invalidParametersargument 'file' should be of type path, but is of type map".

Tried adding another FileBrowse Serivce, here am getting different BrowserPlus HandlerID, Passed the same ID to file object. Still getting the same error.

Would be great if anyone can give some light.....

Code:
imageDropped2:function®{
var thisObj = this;

thisObj.imageParameters.file = thisObj.originalfile;
thisObj.imageParameters.maxwidth = 250;
thisObj.imageParameters.maxheight = 100;
thisObj.$BP.ImageAlter.Alter(thisObj.imageParameters,
function (result) {
console.log('result'+result);
if (!result.success) {
alert("failed to modify image: " + result.error +
result.verboseError);
return;
}

thisObj.$BP.FileAccess.GetURL(
{ file: result.value.file },
function ® {
try{
console.log('inside r values');
var img = document.createElement('img')
img.setAttribute('src', r.value);
var target = document.getElementById("imgplaceholder");
}catch(e){console.log('imageDropped '+e.message);}
});
});
}

by
  • RK
  • Oct 6, 2009
2 Replies
  • Can you show how you set "thisObj.originalfile" ? The error is saying you have a type mismatch - method was expecting a filehandle and instead got an object for the "file" parameter.

    Thanks,

    Steve
    0
  • QUOTE (steven_spencer @ Oct 6 2009, 07:25 AM) <{POST_SNAPBACK}>
    Can you show how you set "thisObj.originalfile" ? The error is saying you have a type mismatch - method was expecting a filehandle and instead got an object for the "file" parameter.

    Thanks,

    Steve


    Thanks Steve for elaborating the error msg.

    This is how am setting file object to a var.

    imageDropped:function®{
    try{
    var thisObj = this;
    thisObj.imageParameters.file = r[0];
    thisObj.orignialimage = r[0];
    thisObj.$BP.ImageAlter.Alter(thisObj.imageParameters,
    function (result) {
    if (!result.success) {
    //alert("failed to modify image: " + result.error +
    //result.verboseError);
    return;
    }
    thisObj.$BP.FileAccess.GetURL(
    { file: result.value.file },
    function ® {
    try{
    var img = document.createElement('img')
    img.setAttribute('src', r.value);

    }catch(e){}
    });
    });

    -regards
    Ratheesh
    0
This forum is locked.

Recent Posts

in Support & General Questions