> In the below example, I am trying to invoke javascript when I click on
> Approve link and also on Disapprove.

Nothing jumps out at me. I'd start by looking at the rendered page to
see what the browser sees. Can you simplify the page down to the
smallest page that fails and include the tml and rendered html?

Josh

On Thu, Jul 1, 2010 at 11:03 PM, SakshiAgarwal <sakshi.a...@gmail.com> wrote:
>
> Hi,
>
> In the below example, I am trying to invoke javascript when I click on
> Approve link and also on Disapprove. [While disapproving, I am submitting
> the form as I want to submit reported category along with it, while on
> approve I am just changing the status[approve/disapprove] of my photo in
> java code ]
> Photos.tml
> <t:loop source="photoDetails" value="each" index="counter">
>   <div t:type="zone" t:id="photoZone" id="prop:zoneId">
>        <t:form t:id="formId" t:zone="prop:zoneId">
>       <t:hidden value="counter"/>
>  [<t:actionlink t:id="approvePhotos" context="${counter}" zone="prop:zoneId"
> t:mixins="Confirm">Approve</t:actionlink>]
>  <p><t:label for="reportedCategory"/>
>         <t:select t:id="reportedCategory" t:label="Category"/></p>
>  <input type="submit" t:type="submit" t:id="photo" value="Disapprove Photo"
> onClick="extraStep(${counter});" />
>  </t:form>
>   </div>
>  </t:loop>
>
> Everything works fine, except that my javascript code is invoked when I move
> from Index page to Photos page and not on clicking 'approve link'. The logic
> which I have used for Disapprove doesn't work with 'approve' actionLink.
>
> my Confirm.java is as follows:
> @IncludeJavaScriptLibrary("Confirm.js")
> public class Confirm {
>
>   �...@parameter(value = "Are you sure?", defaultPrefix =
> BindingConstants.LITERAL)
>    private String message;
>
>   �...@inject
>    private RenderSupport renderSupport;
>
>   �...@injectcontainer
>    private ClientElement element;
>
>   �...@afterrender
>    public void afterRender() {
>            renderSupport.addScript(String.format("new Confirm('%s');",
>                          element.getClientId()));
>    }
>
> }
>
> Confirm.js
> var Confirm = Class.create();
> Confirm.prototype = {
>        initialize: function(element) {
>                alert("element" + element);
>                Event.observe($(element), 'click',
> this.doConfirm.bindAsEventListener(this));
>        },
>
>        doConfirm: function(e) {
>        e.style.display = 'none';
>        alert("in javascript in js file");
>        e.stop();
>        }
> }
>
> Kindly help me as to how can I invoke javascript on clicking approve link.
>
> Looking forward for your support.
>
> Regards
> Sakshi
> --
> View this message in context: 
> http://old.nabble.com/Invoke-javascript-through-Mixin-with-actionLink-and-click-event-tp29052536p29052536.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to