Hi all,
do behaviors works in listGrid components?
I've tried to associate the following behavior:
<d:behavior name="submitOnBlur">
<d:handler event="blur" type="application/javascript">
bb.bjsf.sync(this,'custom');
</d:handler>
</d:behavior>
<d:handler event="blur" type="application/javascript">
bb.bjsf.sync(this,'custom');
</d:handler>
</d:behavior>
to a listGrid and doesn't works, but if the same behavior is assciated to a inputText does.
Regards
David

Focus and listGrid
17 January, 2008 - 11:51 — nick@backbaseYes, it should be possible to apply behaviours to a listGrid. However, the listGrid does not support focus/blur (i.e. it does not inherit from b:focusableElement) and so the blur event never gets fired. Form elements, such as b:button and b:calendar, do support the focus model.
and dblclick and keydown?
17 January, 2008 - 12:16 — DavidI did the same with a behavior with an event keydown and dblclick and I get the error anyway. The error is "Behavior m:closeValueList was not found", however this behavior is defined in m.xml as follows:
<d:handler event="dblclick" type="application/javascript">
// Some code...
</d:handler>
<d:handler event="keydown" type="text/javascript">
// Some code...
</d:handler>
</d:behavior>
I have associated it to the listGrid with this sentence:
and the generated BTL code is:
Do you see something wrong?
Thanks
David
Namespace defined?
19 January, 2008 - 07:19 — RichardDavid,
What is the namespace for the behavior?
The d:behavior needs to be wrapped in d:tdl and d:namespace to be valid.
Your namespace then needs to be associated with the m: prefix by using xmlns:m="...your namespace here.."
The definition of behavior has changed a bit from v3 to v4 in case that is causing confusion. In v3 you could define a behavior anywhere with s:behavior.
Now you must use the d:behavior inside d:namespace inside d:tdl.
Namespace
21 January, 2008 - 08:47 — DavidHi Richard,
In the m.xml the behavior node is enclosed inside a tag :
There are another behavior (linked to an inputText in the jsp) in the same namespace and this behavior works fine.
To relate the namespace I have the following code:
nsMap="m,http://www.mycompany.com">
<xi:include href="../behaviors/m.xml"/>
I think that's all what I need, right?
David
How to register my namespace
6 February, 2008 - 16:48 — DavidHi again,
I've found the problem but not the solution.
When my code is executed and I generate the listGrid this is the xml sent to the client:
My view code is here....
</c:create><e:return /></e:script>
As you can see, all the namespaces from Backbase are declared but mine doesn't.
How can I register my namespace for that request?
I've registered it into the nsMap attrib. from the
<bjsf:application>node.Could you help me, please?
David
Using listGrid's behavior attribute
12 February, 2008 - 20:58 — dimitraHi David,
You can have the proper result by using the listGrid Backbase JSF component attribute "behavior"
Assuming you have your behavior defined in a file behavior.xml like this:
<d:namespace name="http://myCompany.com/">
<d:behavior name="bbb">
<d:handler event="mousedown" type="text/javascript">
alert('This is my behavior');
</d:handler>
</d:behavior>
You can attach this behavior to the JSF listGrid component like this:
<xi:include href="behavior.xml" />
<bjsf:listGrid behavior="custom:bbb" ...>
...
</bjsf:listGrid>
</bjsf:application>
dynamic loading
13 February, 2008 - 08:08 — DavidHi again Dimitra,
You've replied me at another post about something similar. The problem that I'm facing is about pages loaded dynamically. In this loadings the namespaces defined at the bjsf:application level are not present.
You gave me two solutions to define the namespace inline in the client BTL components but I still have the same problems with the JSF components.
listGrid.setId("vlGrid");
listGrid.setBehavior("mapfre:closeValueList");
In this code I create a listGrid dynamically and add it to a panel. The response is posted above, where the namespace is not defined.
I've tried to use your solutions in this approach but here I can't wrap the listgrid inside a
<div "xmlns:mapfre=http:www.mapfre.com">and I can't define the namespace inline.any suggestion?
Thank you Dimitra
david
David
16 February, 2008 - 20:43 — dimitrayou are right in this. I have entered a bug in our system to add this feature.
You should have more flexibility to register custom namespaces to the response.
So far have not been able to find a workaround for you for this use case.
Dimitra
OK
18 February, 2008 - 10:42 — DavidOK Dinmitra,
I'll be expected for new versions.
Thanks a lot
david
I suggest behaviors don't
20 February, 2008 - 11:33 — uiiI suggest behaviors don't works in listGrid this way...