Custom JSF tag not working HELP!!!!

We have a custom tag to display the list of attachments for a a selected entity. So for example if there are entities A, B, C...each entity can have none or 1 or more attachments. When you go to the details page you see the list of attachments if any and an image against it that can be clicked to delete the attachment.
Here is the tag:
<at:attachmentTable value="#{Entity.attachmentList}" remove="#{Entity.removeAttachment}" />
Here is the renderer code for the delete the attachment part of the tag:
private void writeRemove(UIComponent component, FacesContext ctx, ResponseWriter writer, String clientId, Attachment attachment, String parentId) throws IOException {
          writer.startElement("td", component);
          writer.startElement("a", component);
          writer.writeAttribute("href", "#", null);
          writer.writeAttribute("onmousedown", "confirmationDelete(this, 'attachment');", null);
          String encoding = "if(typeof jsfcljs == 'function'){jsfcljs(document.getElementById('"+ parentId + "'),{'" + clientId + "':'" + clientId + "','attachmentId':'" + attachment.getId().toString() +"'},'');}return false";
          writer.writeAttribute("onclick",encoding, null);
          writer.writeAttribute("type", "submit", null);
          writer.startElement("img", component);
          writer.writeAttribute("src", "/acw/images/removeline.gif", null);
          writer.writeAttribute("alt", "", null);
          writer.endElement("img");
          writer.endElement("a");
          writer.endElement("td");
Here is the setProperties method for the tag:
     protected void setProperties(UIComponent component) {
          FacesContext context = FacesContext.getCurrentInstance();
          super.setProperties(component);
          setProperty(component, "value", value);
          setProperty(component, "parameterValue", parameterValue);
          setProperty(component, "parameterName", parameterName);
          if (remove != null && UIComponentTag.isValueReference(remove)) {
               MethodBinding method = FacesContext.getCurrentInstance().getApplication().createMethodBinding(remove, new Class[] {});
               UICommand command = (UICommand)component;
               command.setAction(method);
Here is how the tag renders as an <a> html tag:
a href="#" onmousedown="confirmationDelete(this, 'attachment');" onclick="if(typeof jsfcljs == 'function'){jsfcljs(document.getElementById('entity'),{'entity:j_id_jsp_1417973014_25':'entity:j_id_jsp_1417973014_25','attachmentId':'10326'},'');}return false" type="submit"><img src="/images/removeline.gif" alt="" /></a>
Here is what is heppening:
When you click on the image to delete the attachment, the control somehow nevers goes to the removeAttachement method in the backing bean. As you can see in the tag above (remove="#{Entity.removeAttachment}" ).
I have tried everything and at this point am not able to see what is going worng. Anyone who can see the obvious that I am missing please please do point it to me. I am sort of desperate for a solution....
Thanks.
TD

Anchors don't have a type="submit". You should be basing this on an h:commandLink. In fact you could probably rewrite it all as an XML tag that just generates an h:commandLink.

Similar Messages

  • ScriptLink tag not working for application page sharepoint 2010

    <ScriptLink> tag not working for application page sharepoint 2010 for including javascript in application page, it appends either 1033 or _layout to path specified for javascript.But javascripts are located in custom document library on site and not
    in _layouts folder.
    Please help and explain in details as I tried lot on this.

    Hi,
    Use the following line of code
    <SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/functions.js" Language="javascript" />
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • Ukelele generated custom keyboard layouts not working in Lion?

    I asked this question in the stackexchange site a few days ago.  Nothing I've tried has worked so far, except for creating a new account.  Because a fresh account works, it's got to be something with my preferences, right?
    http://apple.stackexchange.com/questions/21691/ukelele-generated-custom-keyboard -layouts-not-working-in-lion
    Here's the question from above:
    I created a custom keyboard layout with Ukelele (http://scripts.sil.org/ukelele) in Snow Leopard (idea is to generate scandinavian letters with Alt-key, otherwise have a pretty much standard U.S. layout). After the upgrade, the old installed (to ~/Library/Keyboard Layouts) layout wasn't working.
    Ukelele seems to work OK in Lion, but whether I put the generated keylayout in a bundle or single file, or save it "/Library/Keyboard Layouts" or "~/Library/Keyboard Layouts" doesn't seem to matter.
    Help?
    EDIT:
    @Sergio, I cannot choose the layout in Input Sources. One keylayout file I tried:http://semeai.org/~sjl/us-scands.keylayout
    [EDIT: Removed unrelated stuff]
    UPDATE 2011/08/15:
    @Tom:
    Copied your keylayout (it naturally ended up in my Junk folder):
    midgard (01:55) >ls -l ~/Library/Keyboard\ Layouts/MongolianQWERTY.keylayout-rw-r--r--@ 1 sjl  staff  44536 Mar 13  2008 /Users/sjl/Library/Keyboard Layouts/MongolianQWERTY.keylayout
    Logged out, logged in, isn't showing in Input sources (I'm looking very closely between "Maori" and "Myanmar - QWERTY").
    I've also uninstalled bunch of software and plugins giving suspicious messages to system.log, but hasn't helped.
    UPDATE 2011/08/16:
    I created a test account, and lo, the layout works perfectly for it. Also the bug in preferences doesn't show for that account. When trying this on my own account, there are no errors in Console logs with the suggested keywords (I can't seem to locate console.log file, though).
    UPDATE 2011/08/16 later:
    Nuking Library/Caches (and relogging) didn't help.
    UPDATE 2011/08/17:
    I did
    % find Library -name "*.plist" -exec mv {} {}.renamed \;
    and restarted, but it didn't help. I restored the situation with
    % for file in `find Library -name "*.plist.renamed"`; \  do mv "$file" "${file//.renamed/}"; done
    addendum: I also went through all the .plist files with plutil -s as described inhttp://www.askdavetaylor.com/can_i_check_my_plist_files_in_mac_os_x_for_problems .html. There was some brokennes, but in very unrelated applications.

    Tom,
    I think I love you.
    That absolutely did it! Thanks so much!
    If you'll answer with the same link in the stackexchange site, I'll mark the answer as correct, so you'll get the rep there.
    Thanks,
    Sami

  • Urgent: OSB FTP polling is not working, help!!!

    hi all,
    I am doing an onsite poc on customer site, and configuring and proxy service on OSB(11.1.1.5) using ftp , but it just not working, not picking files in the specified folder, no error message. seems it can connect and login, but just not picking the files, though I set the mask to *.*, poll interval 3 seconds. any tricky? someone can help?
    I've read all the documents abt ftp transport, and I can configure file proxy, ftp business service successfully.
    thank you very much in advanced.

    no log still, for DEBUG.
    error will throw in log only if I set the wrong user/password.
    seems it connected to the ftp server, but just not picking the files there. I don't know why. I doubted it's the problem of the path setting, but it's the same for phsical path and relative path. not working.
    help...........

  • After upgrading to iOS 5 I cannot enter to mail (outlook exchange ),contact did not open, general settings - mail contact did not work.help me

    After upgrading to iOS 5 I cannot enter to mail (outlook exchange ),contact did not open, general settings - mail contact did not work.help me

    Hi,
    the settings are gone, i guess. But even worse, I cannot get the iPad2 to play Full HD thru the Apple digital AV adaptor using apps that support  (and advertise this), like AVPlayer HD. This definiteley used to work before one of the last iOS upgrades. (I am now at 5.1.1).

  • When i go in my settings on my ipod touch 3gen it says no wi-fi as in i cant connect to any wi-fi at all i tried to restore but did not work HELP PLEASE

    when i go in my settings on my ipod touch 3gen it says no wi-fi as in i cant connect to any wi-fi at all i tried to restore but did not work HELP PLEASE

    See:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    If not successful, an appointment at the Genius Bar of an Apple store is usually in order.
    Apple Retail Store - Genius Bar

  • Panasonic .MOV files only play audio no video in Premiere Elements 11??? Not Working Help

    Panasonic .MOV files only play audio no video in Premiere Elements 11??? Not Working Help

    It all depends on the codec the file uses, Karli.
    What model of camcorder is this video coming from?
    Are you working on a Mac or a PC? Have you got the latest version of Quicktime, per the program requirements? When you started your project, did you select the settings for a DSLR at 720p? This is a vital step since it will activate the components your computer will need to work with many of these types of files.
    BY THE WAY, KARLI--
    PLEASE do not post the same question more than once on this forum! You've already got a thread going with this same question and several responses posted. It's very confusing when you post the same question a second time and start a whole new discussion.

  • My MacBook Air won't turn on? I have to dropped it but earlier in the day I got a notification about a full single drive. I have tried the ideas in the communities but its still not working, help!

    My MacBook Air won't turn on? I have to dropped it but earlier in the day I got a notification about a full single drive. I have tried the ideas in the communities but its still not working, help!

    See this article:
    http://support.apple.com/kb/ht3964
    Find the section that applies to your computer, and follow the instructions.
    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer. 
    Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.

  • I cant open my ipad after i turned on the voice in accessibility i have a passcode and i tried to enter my password but it not working. help me please

    i cant open my ipad after i turned on the voice in accessibility i have a passcode and i tried to enter my password but it not working. help me please..
    i updated my ipad in ios 6

    Turn off VoiceOver
    1. Press the Home button
    2. Tap Settings.
    3. Then double-tap Settings.
    4. Tap General.
    5. Then double-tap General.
    6. Use three fingers on the screen to scroll to Accessibility
    7. Tap Accessibility.
    8. Then double-tap Accessibility
    9. Tap VoiceOver
    10. Then double-tap VoiceOver.
    11. Tap "On" next to VoiceOver
    12. Then double-tap "On" to turn it off.

  • Lower volume button control not working help?

    Lower volume button control not working help?

    If you only restored from backup, restore to factory defaults/new iPod.  If you then still have the problem it is likely a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Safari 5.1 customized keyboard shortcut not working

    I've just updated safari on snow leopard and my customized keyboard shortcut: go to next/previous panel (ctrl -> and ctrl <-) don't work anymore even if i set them in my system preferences

    I'm also experiencing issues with custom keyboard shortcuts not working after the update to Safari 5.1. I had no problems with the previous version of Safari.... I wish I had not updated.

  • HP pavilion dv6 microphone not working . help please . . .

    HP pavilion dv6 microphone not working . help please . . .

    Hi,
    DV6 is a series of hundreads of models, what is yours ? To help us answer question quicker, please read this:
       http://h30434.www3.hp.com/t5/First-Time-Here-Learn-How-to/Welcome-Get-started-here/td-p/699035
    You may wat to try this first:
    1. Right click speaker icon (right hand corner)
    2. Select Microphone devices
    3. Right click Microphone
    4. Enable it
    5. Click Apply/Ok
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • After update.. i can not start the ipad, when i press agree in the terms ...it will freeze and the screen not working///help please

    after update.. i can not start the ipad, when i press agree in the terms ...it will freeze and the screen not working///help please

    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
     Cheers, Tom

  • On my iPhone 5 camera photographed not clear. blurry pictures, autofocus does not work. help please!

    on my iPhone 5 camera photographed not clear. blurry pictures, autofocus does not work. help please!

    Could you please describe how you are trying to delete a single text message and it will not work? What are you seeing in place of the trash can icon?

  • HT201210 I can not restore my iPhone 4S itunes error says I have 29 and I put it in DFU mode and not working help please

    Hello

    I can not restore my iPhone 4S itunes error says I have 29 and I put it in DFU mode and not working help please

Maybe you are looking for

  • Why does the on-screen keyboard disappear once a Bluetooth device has been attached?

    Once I've connected a bluetooth device to my ipad 2, the on-screen keyboard disappears and doesn't return until I re-start the ipad.  I've tried this with both a bluetooth keyboard, as well as with a bluetooth pedal, which will do page up, page down,

  • Fire Wire 800/400 Ports

    Could someone kindly advise if On a Mac G5 ... if a FW400 perhiperal could also be used the FW800 port ? Thanks

  • One business area data is not reflecting queries   very urgent

    we had two business areas under one chart of account .while executing the query the fig of one business area not reflecting in queries what could be the reason. please i will assign full points give me best solution.Very urgent Regards, sampath

  • Can I submit order data to a third party?

    We would like to add an order form for a product that is produced and shipped by a warehousing & fulfillment company. Can we hook into BC's ecommerce module and extract field data to create an XML file to submit to the supplier?

  • Adobe Premiere Elements 13 freezes

    Big problem! When I drag and drop a title from assets to my time line in expert mode, the program crashes... Happens most of the times. iMac 2,7 gHz, 8 GB Ram, iOS 10.9.5 Help please