Current Position:Home > Problem with ClientListener in custom component

Problem with ClientListener in custom component

Update:10-11Source: network consolidation
I have custom declarative component:
<af:commandImageLink icon="/img/trash.png" actionListener="#{TrashButtonBean.deleteRow}">
<af:setActionListener from="#{row.rowKeyStr}" to="#{TrashButtonBean.currentRowKetStr}"/>
*<af:clientListener type="click" method="confirm( 'Confirm delete' ); "/>*
It works but without ClientListener. Investigating with Firebug I found that onclick event always returns false and blocks operation:
<span class="nodeLabelBox repTarget">&lt;<span class="nodeTag">a<span class="nodeAttr editGroup"> <span class="nodeName editable">id="<span class="nodeValue editable">j_id_id4:j_id_id8:j_id_id14:7:j_id_id46:j_id_id1pc3"<span class="nodeAttr editGroup"> <span class="nodeName editable">class="<span class="nodeValue editable">xup"<span class="nodeAttr editGroup"> <span class="nodeName editable">href="<span class="nodeValue editable">#"<span class="nodeAttr editGroup"> <span class="nodeName editable">onclick="*<span class="nodeValue editable">return false;*"<span class="nodeBracket editable insertBefore">&gt;
<div class="nodeChildBox"><div class="nodeBox emptyNodeBox repIgnore selected"><div class="nodeLabel"><span class="nodeLabelBox repTarget"> &lt;<span class="nodeTag">img<span class="nodeAttr editGroup"> <span class="nodeName editable">id="<span class="nodeValue editable">j_id_id4:j_id_id8:j_id_id14:7:j_id_id46:j_id_id1pc3::icon"<span class="nodeAttr editGroup"> <span class="nodeName editable">class="<span class="nodeValue editable">xus"<span class="nodeAttr editGroup"> <span class="nodeName editable">src="<span class="nodeValue editable">/ReusableComponentsTest-ViewController-context-root/img/trash.png"<span class="nodeBracket editable insertBefore">/&gt;
<div class="nodeCloseLabel"><span class="nodeCloseLabelBox repTarget">&lt;/<span class="nodeTag">a&gt;
Any idea.

The Best Answer

Using af:popup I get PPR - null pointer exception, because popup behavior blocks af:setActionListener that I use to pass rowKeyStr to managed bean.
Your solution also doesn't work. here is my code:
&lt;af:componentDef var="attrs" componentVar="TrashButton"&gt;
&lt;script type="text/javascript"&gt;
function confirmDelete(){
var agree=confirm('Confirm delete');
if (agree){
return true ;
return false;
&lt;af:commandImageLink icon="/img/trash.png" actionListener="#{TrashButtonBean.deleteRow}"&gt;
&lt;af:setActionListener from="#{row.rowKeyStr}" to="#{TrashButtonBean.currentRowKetStr}"/&gt;
&lt;af:clientListener type="click" method="confirmDelete"/&gt;
  • Problem with ClientListener in custom component Update:10-11

    I have custom declarative component: <af:commandImageLink icon="/img/trash.png" actionListener="#{TrashButtonBean.deleteRow}"> <af:setActionListener from="#{row.rowKeyStr}" to="#{TrashButtonBean.currentRowKetStr

  • Problem with attributes in custom component Update:10-11

    Hi All, I am creating a simple jsf PanelGrid custom that component I am adding two new attributes.... when I use that tag in my jsf application it is rendering fine in the client side....but the parent class that is PanelGrid componen

  • Custom Component Error -- Uggh Update:10-11

    I have tried to solve the problem using online resouces, 3rd party message boards, Xcelsius tutorials, the textbook "Xcelsius 2008: Dashboard Best Practices", tutorials which came with the Xcelsius SDK, among others, however, I continue to run i

  • Excpeption creating custom component Update:11-30

    Hi all, I'm using Sun's RI 1.2 to create a custom component that consist of standard components. My problem is that this custom component renders ok but when I submit the form that contains it I get an IndexOutOfBoundsException. Can anyone please tel

  • Problem with inputText in my custom component Update:10-11

    Hi, I have a custom dataTable component that I'm trying to get to work. It has to be a custom component because dataTable doesn't support rowspan, colspan, multi line headers, and a rendered attribute for rows. The problem is, that when I wrap the co

  • Custom component and custom event problem Update:11-30

    hello , i have a strange problem since one week , is that i can't handle the events becoming from my custom component , here is my code : Event Class : package events      import;      public class Ev extends Event           public

  • Problem custom component with children in RestoreView phase Update:11-30

    Hi there! I've got a problem with a custom component that I am writing. It consists of several UISelectOne and UIInputText components. Depending on the value selected in the UISelectOne components, the UISelectOne and UIInputText components may chang

  • Custom component problem Update:10-11

    I wrote a custom component: Here is the code for the UIComponent: package customcomponents; import javax.faces.component.*; import javax.faces.context.*; import java.util.Vector; import jsf.*; public class UIEventsTable extends UIComponentBase {     

  • Custom Component or Other solution to this problem... Update:11-30

    Hello, In my pages I have a wizard type menu consisting of: [ prev   curr-title    next ] The code to build this menu looks like so: <h:panelGrid      id="top_flow_navigation"      columns="3"      styleClass="wizardNavTable&qu

  • Unable to Edit the View in Custom Component Update:10-11

    Hi Experts, Please help me to resolve this issue ! I am unable to lock the BOL Entity in my custom component using BTAdminH. I have written the below code in the Edit event Handler for Edit Button. The lr_entity->lock( ) condition statement is gettin