You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Tan CyberT@n" <qu...@gmail.com> on 2009/03/16 10:20:59 UTC

ActionLink button called twice when onclick.

Hi,

I have a problem on my ActionLink button. it call twice onActionFrom
after i have clicked on it.
below are my coding.  is anyone have any idea on it?

Thank you.
Regards,
tan
TML:

<t:GRID
           t:id="grid"

           t:source="Materials"
           t:Model="MaterialModel"
           t:row="Material"
           t:rowsPerPage="10"
           t:pagerPosition="both"
           t:inPlace="literal:true">


               <t:parameter name="Cell">
               <t:if t:test="SoConvert">
                   <t:actionlink t:id="select" t:mixins="confirm"
t:message="Are you sure you want to Convert?"  t:context="Material.id"
>
                       <button>Convert</button>
                   </t:actionlink>
                   </t:if>
               </t:parameter>
           </t:GRID>

class file:
void onActionFromSelect(Long id)
    {
        try
        {
                System.out.println("clicked");
        }
        catch (Exception e)
       {
             System.out.println("error");
        }
    }


Console message :

clicked
clicked

Re: ActionLink button called twice when onclick.

Posted by DH <ni...@gmail.com>.
Hi,

I am not sure whether it is produced by button nested in <a>.
What about replacing <button>Convert</button> with 'Convert' and have a try?


Thanks,
DH


----- Original Message ----- 
From: "Tan CyberT@n" <qu...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, March 16, 2009 5:20 PM
Subject: ActionLink button called twice when onclick.


> Hi,
> 
> I have a problem on my ActionLink button. it call twice onActionFrom
> after i have clicked on it.
> below are my coding. is anyone have any idea on it?
> 
> Thank you.
> Regards,
> tan
> TML:
> 
> <t:GRID
> t:id="grid"
> 
> t:source="Materials"
> t:Model="MaterialModel"
> t:row="Material"
> t:rowsPerPage="10"
> t:pagerPosition="both"
> t:inPlace="literal:true">
> 
> 
> <t:parameter name="Cell">
> <t:if t:test="SoConvert">
> <t:actionlink t:id="select" t:mixins="confirm"
> t:message="Are you sure you want to Convert?" t:context="Material.id"
>>
> <button>Convert</button>
> </t:actionlink>
> </t:if>
> </t:parameter>
> </t:GRID>
> 
> class file:
> void onActionFromSelect(Long id)
> {
> try
> {
> System.out.println("clicked");
> }
> catch (Exception e)
> {
> System.out.println("error");
> }
> }
> 
> 
> Console message :
> 
> clicked
> clicked
>