bb.bsjf.sync(..) event being ignored

Hi,

I am trying to make an event fire to a session bean when a page loads with the following code. This does not make it through to the backing bean, however I did ascertain the the event was being fired to some of the myfaces code. Am I doing something wrong or is this a bug?

<!-- -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://www.backbase.com/2007/jsf" prefix="bjsf"%>
<html>
<body>
<f:view>
        <bjsf:application id="app">
                <f:verbatim>
                        <xi:include     href="<%=application.getInitParameter("com.backbase.bjsf.CLIENT_BOOT_DIR")%>/engine/debugger/debugger.xml" parse="xml"></xi:include>
                        <xi:include     href="<%=application.getInitParameter("com.backbase.bjsf.CLIENT_BOOT_DIR")%>/bindings/config.xhtml_btl.chameleon.xml" parse="xml"></xi:include>
                        <xi:include     href="<%=application.getInitParameter("com.backbase.bjsf.CLIENT_BOOT_DIR")%>/bindings/www.backbase.com.2007.jsf.client/server.xml" parse="xml"></xi:include>
                        <bjsfc:server url="index.jsf" identify="id"     loadingMessage="__loadingMsg"></bjsfc:server>
                        <b:loadingMessage id="__loadingMsg">Loading...</b:loadingMessage>
                </f:verbatim>
               
                <bjsf:panelSet rows="*">
                        <bjsf:panel id="applicationRoot" customActionListener="#{bootstrap.boot}" binding="#{bootstrap.applicationRoot}">
                                <f:verbatim>
                                        <e:handler event="DOMNodeInsertedIntoDocument" type="application/javascript">
                                                <![CDATA[
                                                bb.bjsf.sync(this, 'boot');
                                                ]]>
                                        </e:handler>
                                </f:verbatim>
                        </bjsf:panel>
                </bjsf:panelSet>
        </bjsf:application>
</f:view>
</body>
</html>

My Bean has the following method in it.

public void boot (CustomActionEvent event) {
        boot();
}

Thanks for any help recieved.

Stuart

It seems that if I put the

It seems that if I put the customActionListener onto a bjsf:commandButton the custom action listener event DOES fire through to the backing bean. It is a bug with the bjsf:panel and the customActionListener not routing events to the backing bean.

As the event fires for both I don't really understand why it is not picked up for a panel, but is for a command button. Could someone clear this up for me please?

                                <bjsf:commandButton customActionListener="#{bootstrap.boot}" value="Button">
                                        <f:verbatim>
                                                <e:handler event="DOMNodeInsertedIntoDocument" type="application/javascript">
                                                        <![CDATA[
                                                        bb.bjsf.sync(this, 'launch');
                                                        ]]>
                                                </e:handler>
                                        </f:verbatim>
                                </bjsf:commandButton>

inputText doesn't works either

Hi, I've tested your issue with an inputText and it doesn't works.
Really, what it's not supported are different events than "custom" ie:
If I write:

<e:handler event="DOMNodeInsertedIntoDocument" type="application/javascript">
        <![CDATA[
                 bb.bjsf.sync(this, 'launch');
       ]]>
</e:handler>

it doesn´t works at all, but if I write:
<e:handler event="DOMNodeInsertedIntoDocument" type="application/javascript">
        <![CDATA[
                 bb.bjsf.sync(this, 'custom');
       ]]>
</e:handler>

it works fine.

is it a bug?
why buttons, panels and inputs have different behaviors?

I hope someone from Backbase stuff can help us with this.
Thanks and kind regards
David

Hi David, Thanks for

Hi David,

Thanks for replying, what you write is interesting because as far as I know it *SHOULD* work like this:

If you try the code below you should find that your 'custom' event is handled by the "else if" clause, whereas my 'launch' would be handled by the "if" clause. I say this because I think it is perfectly valid to do bb.bjsf.sync(this, 'launch') and/or bb.bjsf.sync(this, 'custom'). This would allow the framework to be more flexible with custom events, which is surely what Backbase intended?

public void boot (CustomActionEvent event)
{
        String eName = (String)event.getAtts().get("event");
        if("launch".equals(eName))
        {
                boot();
        }
        else if("custom")
        {
                bootCustom();
        }
}

I think the possible bug lies in the directing of events from the underlying framework through to the bound Backbase UIComponent. I'm 100% sure the bb.bjsf.sync() is getting through to the server side myfaces framework, even for panels. It's just that nothing raises it's hand and handles the event. It appears that perhaps certain kinds of UIComponents don't do what is necessary for them to become registered for event handling or their scope is heavily narrowed.

Thanks,
Stuart

Hi Stuart, I'm not sure

Hi Stuart,
I'm not sure where is the bug, someone from Backbase must help us, but what I know that if you test your code with an inputText the method "boot" is not invoked.
I suppose the Backbase framework decodes the events from client side and they are doing it in diffenrent ways for panels, modal, inputs...
I've solved with this approach:

    <e:handler event="focus" type="text/javascript">
        <![CDATA[
             bb.bjsf.sync(this,'custom','myEvent','launch');
        ]]>
    </e:handler>

public void boot (CustomActionEvent event)
{
        String eName = (String)event.getAtts().get("myEvent");
        if("launch".equals(eName))
        {
                boot();
        }
        else if("custom")
        {
                bootCustom();
        }
}

If someday you have to use an input component, maybe this code could be useful for you.

Kind regards
David