The following code works find under BB 4.1.2 but not under 4.2. I get an error on the c:create element that says:
Prefix lookup in the target context is deprecated. An NSResolver might be missing..
All I am doing is creating a simple window. What has changed in BB 4.2? What functionality has been deprecated? What is the error message trying to say?
<!---->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Backbase 4.2 Example</title>
<style type="text/css">
* {
font-family: "Microsoft Sans Serif", Arial, Helvetica, sans-serif;
font-size:12px;
}
html,
body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#desktop {
width:100%;
height:100%;
background-color:#CCFFCC;
margin:5px 5px 0 5px;
padding-right:10px;
padding-bottom:7px;
}
</style>
<script type="text/javascript" src="/Backbase/4_2_0/engine/boot.js"></script>
</head>
<body>
<script type="application/backbase+xml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://www.backbase.com/2006/btl"
xmlns:c="http://www.backbase.com/2006/command"
xmlns:e="http://www.backbase.com/2006/xel"
xmlns:xi="http://www.w3.org/2001/XInclude"
style="height:100%;width:100%">
<!-- include BTL widgets -->
<xi:include href="/Backbase/4_2_0/bindings/config.xml" />
<e:xel>
<e:function name="open-window">
<e:body type="application/xml">
<c:create destination="id('desktop')/b:windowArea" mode="appendChild" >
<b:window open="true" />
</c:create>
</e:body>
</e:function>
</e:xel>
<div id="desktop">
<b:windowArea>
<h2>Test of b:window Creation</h2>
<a href="javascript:void(0)">
Click here to open window
<e:handler event="click">
<e:call function="open-window" />
</e:handler>
</a>
<b:taskBar windowArea="id('desktop')/b:windowArea[1]" />
</b:windowArea>
</div>
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Backbase 4.2 Example</title>
<style type="text/css">
* {
font-family: "Microsoft Sans Serif", Arial, Helvetica, sans-serif;
font-size:12px;
}
html,
body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#desktop {
width:100%;
height:100%;
background-color:#CCFFCC;
margin:5px 5px 0 5px;
padding-right:10px;
padding-bottom:7px;
}
</style>
<script type="text/javascript" src="/Backbase/4_2_0/engine/boot.js"></script>
</head>
<body>
<script type="application/backbase+xml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://www.backbase.com/2006/btl"
xmlns:c="http://www.backbase.com/2006/command"
xmlns:e="http://www.backbase.com/2006/xel"
xmlns:xi="http://www.w3.org/2001/XInclude"
style="height:100%;width:100%">
<!-- include BTL widgets -->
<xi:include href="/Backbase/4_2_0/bindings/config.xml" />
<e:xel>
<e:function name="open-window">
<e:body type="application/xml">
<c:create destination="id('desktop')/b:windowArea" mode="appendChild" >
<b:window open="true" />
</c:create>
</e:body>
</e:function>
</e:xel>
<div id="desktop">
<b:windowArea>
<h2>Test of b:window Creation</h2>
<a href="javascript:void(0)">
Click here to open window
<e:handler event="click">
<e:call function="open-window" />
</e:handler>
</a>
<b:taskBar windowArea="id('desktop')/b:windowArea[1]" />
</b:windowArea>
</div>
</script>
</body>
</html>

It has something to do with...
15 May, 2008 - 23:45 — nbeverI don't use the tag library function, but I ran into this same issue with the javascript function "bb.evaluate" which is used to locate elements much like the 'destination' field. In 4.2 some support was added to handle namespace issues so whenever I try to find a destination that has a prefix (like b:) I have to pass in an extra argument that allows the call to reconcile the namespace argument. This is what an NSResolver is. You'll probably need one in order to make your destination parameter work since it's targeting something in the "b" namespace but I can't see any documentation as to how to add that information in the tag library.
I had to do this in javascript:
bb.command.create( aWindow, dest, 'appendChild' );
Then the NSResolver is something defined in a global variable like this:
{
var ns = { 'b':'http://www.backbase.com/2006/btl',
'e':'http://www.backbase.com/2006/xel',
'c':'http://www.backbase.com/2006/command' };
return ns[prefix] || null;
}
How to do this in the tag library... I don't know but something like this will get past your error.
It would be very interesting to see how to incorporate an NSResolver in the tag library though!
-Nate
Re: e:function and prefixes in its body
16 May, 2008 - 10:09 — SergeyNate,
Thank you very much for your observation.
This is definitely a regression, I entered the issue into our issue tracker.
Sergey/
Hopefully, this will be
30 May, 2008 - 20:23 — PiotrekHopefully, this will be fixed in the next Backbase release. But when is it going to happen?
Re: Q&A
16 May, 2008 - 10:27 — Sergeymwr,
> What has changed in BB 4.2?
> What functionality has been deprecated?
> What is the error message trying to say?
The change mentioned in the warning (please note, this is not an error, but a warning, and your code still works!) concerns the fix to the XML processing runtime: The prefixes lookup for the elements within XML executable should be performed in the context of executable (in this case - command), not in the context of the execution target (in this case - node pointed by @destination). Prior 4.2 we had a fallback mechanism that would lookup prefixes definitions on the target in case a prefix definition was not found in the context of executable. This mechanism is scheduled for deprecation.
Your case clearly demonstrates that having the fallback mechanism deprecated would result into sever execution error when executing a e:function that is a bug, from which engine currently luckily recovers with the mentioned mechanism.
Sergey/
NSResolver Warning
16 May, 2008 - 17:13 — mwrHow do I make this warning go away? Is there a preference I can set somewhere so that these kinds of non-errors are not displayed? It looks bad to managers when it pops up in a demonstration of ongoing development work.
Re: How do I make this warning go away?
16 May, 2008 - 17:41 — SergeyYou can either switch to using "optimized" version of Backbase engine (available in the package as of 4.2) when presenting - there no errors get reported to the backbase development console, or you can put an attribute release="true" on the script tag containing a reference to backbase engine.
Sergey/