1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting changed data-value in Controller

Discussion in 'XenForo Development Discussions' started by MOZ, Jan 30, 2013.

  1. MOZ

    MOZ Well-Known Member

    I am working on a addon that deals with attachments. I have a checkbox and to pass its checked state, this is what I am doing:

    Using JS onClick, I change the data-value of a HiddeInput in the attachment_upload_button template.
    The data-value of this HiddenInput is read by the XenForo_ControllerPublic_Attachment::actionDoUpload and then further action is taken.

    The issue is that data-value is successfully changed (Check by sending alert onClick with value of data-value) however this change is not reflected in the actionDoUpload function (Checked by dumping the value read by the controller)
     
  2. MOZ

    MOZ Well-Known Member

    Anyone? Please?
     
  3. digitalpoint

    digitalpoint Well-Known Member

    The attachment upload button is really a Flash object that reads those settings when it inits. It doesn't go back and read them if you change them after it inits. Or am I not understanding what you are trying to do?
     
  4. MOZ

    MOZ Well-Known Member

    Ah, OK. So I could go about reloading the flash object only when the checkbox state is changed?
     
  5. digitalpoint

    digitalpoint Well-Known Member

    Not sure, never tried it... if that's what you need to do, you could try I suppose.
     
  6. MOZ

    MOZ Well-Known Member

    Any pointers on how to go about it?
     
  7. digitalpoint

    digitalpoint Well-Known Member

    No idea... Never tried to do something like that before, sorry...
     
  8. MOZ

    MOZ Well-Known Member

    No, issues.
     
  9. MOZ

    MOZ Well-Known Member

    I was able to reload the button with the new parameters for SWFUlpoad (The flash based upload that XF uses), however unlike normal SWFUpload, here the parameters are passed as span attributes, so anyone know how to send these as parameters for the button.
     
  10. Syndol

    Syndol Guest

    What's the importance of using the button? Why can't you just use the form?
     
  11. MOZ

    MOZ Well-Known Member

    What form?
     
  12. MOZ

    MOZ Well-Known Member

    The motive is to pass an additional parameter to the attachment uploader however this additional parameter may be toggled by the user at the time of the attachment.
     
  13. Syndol

    Syndol Guest

    Ah, I misunderstood you.
    I tried what you described and could not get it to work either. Sorry.
     
  14. MOZ

    MOZ Well-Known Member

    Any suggestions anyone?
     
  15. MOZ

    MOZ Well-Known Member

    Bump for help.
     

Share This Page