ScriptUI Checkbox onClick fires differently in CS5 vs CS3?

I'm developing an application consisting of a ScriptUI interface and a custom InDesign template. The ScriptUI interface contains a few checkboxes, with onClick event handlers assigned to read their value and store them to a preferences variable whenever they change. This all works perfectly in InDesign CS3 which was my primary development environment.
Now I need to get this application compatible with InDesign CS5, but the checkboxes seem to consistently be returning the wrong value. No matter whether my event handler reads this.value, event.target.value or a direct reference to the checkbox, the returned value is the opposite of the expected. If I use the direct reference to read the value from elsewhere though, the returned value is correct! It almost seems like in CS5 the onClick event handler is fired before the value is changed, while in CS3 it is fired after the value is changed. Just tried CS4 and it seems to behave the same way as CS5.
Did they actually change the checkboxes to behave this way (which makes no sense to me) or am I doing something wrong? Is there any way to get the old behavior back, or is the only solution to manually invert the value if the script detects CS4 or later as the runtime?

Mayhem SWE wrote:
 I wonder how the execution order is in a web browser. The only valid reason I can come up with to justify the CS4/5 change would be if this is how a web browser would behave (perhaps in order to give you an opportunity to cancel the event before the value is changed?), but it is still quite confusing and illogical IMHO...
I totally agree with you. The reason behind this —I think— is that the ScriptUI event model has been modified in CS4 in order to enhance the compliance with the DOM Level 3 Events Specification — http://www.w3.org/TR/DOM-Level-3-Events — which states that the click event must be cancelable. Thus you probably can use myClickEvent.preventDefault() in CS4/CS5 while this probably has no effect in CS3 (not tested). I suppose that the checkbox value should be actually changed if and only if the event is completed and not canceled. That makes sense, but the counterpart is that there is no more equivalence between using the onClick handler and a 'pure' click event listener: myWidget.addEventListener(...)
On this subject, the specification says that using the shortcut myWidget.onEvent = myFunction to register an 'event listener' depends on the host language: "Because the details of this are often language-specific, this type of event listener registration is not defined in this specification, but in general, any event type may be used as an attribute in this way by adding the prefix on- to the event type name, and events so dispatched should behave consistently with the event registration and propagation defined in this specification, with the same interfaces, properties, and methods." —DOM Level3 Events Specification, 4.3 "Interface EventTarget", note 2.
Of course, the easiest approach is to use myCheckbox.onClick = ... since the handler is called once the value has been updated, whatever the version of ScriptUI. But I don't believe it's a good practice if you're working on a complex project —especially a library!— because the onClick handler can be easily rewritten by the client code, and because you may need to deal with event propagation/cancellation at a deeper level. For my part I always use addEventListener(...) and removeEventListener(...) in my library code, although it implies that I fit my implementation to the ScriptUI version. (In CS3, reversing the checkbox value, etc.) That way the client code cannot pollute the basic behavior of my widgets.
Hope that helps,
@+
Marc

Similar Messages

  • Is Photoshop CS6 different from CS5?

    I recently went back to school to expand my career skills and the next class in line for me, is Photoshop. I’m trying to find out if I’m OK with CS5 or if I need to upgrade to CS6. As I just mentioned, I currently have CS5. For a couple classes I completed this year (Flash and Dreamweaver), I was able to use CS5 without any issue, limitations, or instances of “Yeah that can be done, but only on CS6.” I also did not have instances in the class lessons of “You can do this, but not if you’re on CS5.” However, from what I heard/read, Photoshop seems to have had the most significant changes in the CS6 update.
    Here are my questions:
    Please, from a technical perspective only, do I need to upgrade to CS6?  Will being on CS5 on my home computer put me at a disadvantage in class when I'm being taught via CS6? Is Photoshop CS6 significantly different from CS5 where if being taught via CS6, I would be lost or very limited on CS5? When you upgraded to CS6 did you feel like you were learning a new program, or was it the same as CS5, just with a few new “nice to have” features?
    Again, please provide information from a technical perspective only. If the decision to spend $2000 for CS6, was based on preference, I would have had CS6 a long time ago. Also, please don’t recommend CC because I’m not ready to upgrade to subscription based software yet.
    Thanks!

    Have you tried running the trial version of CS6 for 30 days to get a feel for the software and perhaps answer for yourself the many questions you obviously have?
    Try http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    Or http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • Need checkbox onclick somehow to run SQL query

    Hello all,
    Now, I know directly I cannot do this with a javascript function.  What I need to do is with a checkbox onclick
    set a hidden field to the type of the data that is selected by the checkbox.  So, if I select the name of a person,
    the onclick method needs to let the hidden field know we have a "person" entity type. I need this type because
    when I do my true submit, that form field when read will denote what next page I need to bring up in a new tab.
    The question I have is ok, I can attempt to do this a couple of ways, following:
    1)  Come up with an AJAX call that will run a function on the server.  What I do worry about is
    submitting the page and ending up losing boxes that were checked.  I also don't want a long
    form submittal after every click.
    OR
    2)  Forget the onclick method, create a blank .cfm form, then use that form to run the query for the
    types of data, and then call the page to be displayed?  Again, I'm new, so I don't know if this could
    be weird in how the page comes up for display?
    Thanks in advance!!!!!

    Hey Dan,
    Yep, I'm very new at using CF, so I pretty much stink at it compared to you all.  However, I fixed my one problem in that I don't need
    to do anything with SQL queries with onclick.  I combined a bunch of forms into one and process stuff on that page.  Matter of fact,
    I needed to do that.
    However, what I do have a problem with is one last part of my keeping checkbox values when paging.  I can do almost everything,
    meaning, keep track of checkbox values when checked by having a list of those values in session.  I can check the boxes when
    I go back to the page with a simple <CFIF> block when the checkboxes are created for the page.
    The issue I have now is how I can delete a value from the session list when a checkbox is unchecked.  I don't know if I should
    keep track of the exact page number, or whatnot.  All I have now is a list of node ids.
    Any ideas?
    Thanks,
    Ed

  • Opening CS5 in CS3 outlines fonts COOP Heavy

    Am preparing to update an agency from CS3 to CS5.5. Finding that saving a Illustrator CS5.1 files down to CS3 outlines one of the fonts that had appearance attributes(all from the top half Ilustrator Effects). They own the font, and I tried with both PDF On and Off(notice blue bubbles at bottom) and got outlined font for Coop Heavy.
    As a test I set Coop Heavy all by itself on a fresh page, and it went over. 
    Anyone know how I can save  CS5 to CS3 and not get outlined fonts? Any tips for updating an agency to CS5.1 anyone has found?

    I progressivley dummied down the logo, and it appears that offset path is one thing that causes CS5 to CS3 to outline type.
    Anyone else out there opening CS5 files in CS4 or 3 and finding loss of editablility in files, or a solution for this? Prepress houses are always asking us to save down to CS3, so must be people who know more about this. When you place CS5 files in CS3 seems all font gets oultined. Anyone find any way to stop fonts getting outlined? Before I start rolling out CS5, I need to develop a plan to cause minimum interruption to workflow.

  • Looking to upgrade to CS5 from CS3

    HI everyone! I'm looking to upgrade to CS5 from CS3 Master Collection. Is there an easy way of doing this? I have zero interest in anything cloud related or CS6. thanks so much in advance!

    As said by Brett already, you can no longer get CS5 or below from Adobe.
    If by any chance, you make your mind to get CS6, Here is where you can get it. Creative Suite 6
    Cheers!
    ~ Arpit

  • Work flow issue (CS5 vs CS3)

    We recently upgraded to CS5 from CS3.
    After a new Incopy CS5 document is flowed in to InDesign CS5 we are having an issue opening that document again in InCopy CS5.  When double clicking on it on the server the default program to open it is InCopy CS3 even though no CS3 program has ever touched the document.
    Is there a default setting that needs to be changed to make the default program CS5 Incopy?
    Thanks.

    Try clicking on the the little hand icon in the top left hand corner of the CS5 Curves dialog - then you get an eyedropper for your cursor and as you run this over the image you will see the little ball move up and down the diagonal line in curves. To place a point on the composite RGB curve, simply click. To place a point on all 3  R,G, and B curves you Ctrl+Shift+click.

  • INDD CS5 to CS3

    I've read the post on how to save from CS5 to CS4 and I've saved the file to a ".idml" file but cannot open it in CS3. We upgraded from CS3 directly to CS5, any suggestions on saving from CS5 to CS3? - Thanks

    You're SOL.
    A hack to get from CS4 to CS2 was published http://indesignsecrets.com/double-downsave.php
    I'd look into getting a version of CS4 really quick, but I would not expect it is available as CS5 has been released. A call to Adobe may be the only recourse. (Pack a lunch for that call)
    Several persons here would save a CS5 inx or inml to CS4 and supply a CS4 inx for CS3, but that is going to be laborsome if you need to keep many files CS3 compatible.
    From here forth, never overwrite your CS3 files, rename them soon, apply a write only attribute, whatever it takes if you will need compatibility.

  • CS5 vs CS3 with XML

    We're on the cusp of switching from CS3 to CS5 and just received a request to do layout from XML files.
    I know very little of XML and how to deal with it in InD and will be doing a crash course over the next two weeks, I'm also far more familiar with CS3 both (layout and scripting) than CS5.
    Are there any worth while advantages to working with the XML in CS5 over CS3?
    Many thanks,
    Ken

    We have an existing set of sample pages for a series. The client is trying to find the best way to get the back list of the series to the web as well as prepared for traditional book printing and are testing some things, one of which is having the content created and tagged in XML and trying to use that for both getting the product to the web and prepared in InDesign for printing.
    So, we have an existing InDesign file that should have all the styles to lay the books out and newly created XML files that we have to import into InDesign.
    I'm going to try looking in to the evaluateXPathExpression and try to determine how helpful it might be. Maybe that will make it worth moving to CS5 ASAP.
    The looking I've done over the last couple of days has pretty much confirmed your initial assessment of a "world of hurt." Oy.
    Thanks,
    Ken

  • Photoshop CS5 u.CS3 über die Cloud?

    Ich habe die Photoshop Cloud. Gibt es eine Möglichkeit frühere PS Versionen (cs 3 und cs 5) auch zu laden? Oder müsste ich mir die kaufen? Ich brauche die nur um anderen zu helfen. Also ich selber arbeite nur mit CC bzw. CC 2014.
    MfG

    Danke für ihre Antwort.
    Wie ich  CS6 in der Cloud laden kann, weiß ich. Ich wollte wissen, ob man mit der Cloud auch CS5 bzw CS3 laden kann. Wenn ich auf die Seite von CS5 gehe, steht da, dass man eine Seriennummer braucht, aber ich habe CS5 nie gekauft, also auch keine Seriennummer. Da ich CS6 über meine Cloud laden kann, ohne estra etwas bezahlen zu müssen, dachte ich. Es geht vielleicht auch mei älteren Versionen. Es wäre eine Erleichterung für mich.

  • ScriptUI openDialog not working downgrading from CS5.5 to CS4

    So here is my newest bit of fun.  The scripts I have been writing have been in CS5.5, but I was informed today that they need to run on CS4.
    Most everything seems to be working, except one critical piece. Here is  a quick summary of what I am doing. 
    I am opening a window that has two text boxes and two buttons.  The first button opens up a file dialog box that lets the client choose where their XML file is located.  When they select it and click ok, it populates the first text box with the path. 
    The second button opens up a folder dialog box that lets the client choose the location of their images folder, and when they click ok, it populates the second text box with the path. 
    Everything works peachy in CS5.5.  But when I tried it in CS4, this is what it is doing.  When I choose a file and click OK, it is populating the text box with the word "File".  When I choose a folder, it is populating the second box with the word "Folder"
    Here are the relevant functions:
    f2.onClick = function()
         tf = File.openDialog("Select your XML File","*.xml");
         if (tf != null)
              e2.text = tf;
              tf = tf.fsName;
    f3.onClick = function()
         var tfol = new Folder("~/My Documents")
         tfo = tfol.selectDlg("Get Folder");
         if (tfo != null)
              e3.text = tfo;
              tfo = tfo.fsName;
    Like I said, this is working fine is CS5.5, but I need to know what is different in CS4 and how to get it to work.
    Thanks in advance for all your help.

    Add a line to your code:
    if (tf != null)
         $.writeln (tf.constructor.name);
          e2.text = tf;
          tf = tf.fsName;
    And run your script from the ESTK with the console open. You'll see that File is printed. So tf is not a string but a file object. Use e2.text = tf.fsName to display the file's full path name or e2.text = tf.name to show just the name. The same applies to the other function, the one that shows Folder instead of the folder's name.
    Peter

  • Drop shadow from one master appearing on a page with a different master CS5

    I have a series of curriculum books that make use of two different page styles controlled by two masters. On occasion in the books, the two masters appear side by side in a spread. Both masters contain similar background graphics but one has more side margin than the other.  In the instance where the side margin appears on the left hand page, the drop shadow from a background element on the full page master appears on the bigger margin page. The actual object that has the shadow is not there, but the shadow is. This only happens when the margin is on the left; the shadow does not appear when the masters are side by side in a spread and the wide margin is on the right.  See attached image.
    I can split the pages apart and the shadow goes away, but this gets to be a pain when text reflows and I have to change the pages around.  Any idea how I can keep this ghosted effect from appearing where it isn't supposed to be?
    I'm on CS5 on an Intel Mac running Leopard.
    Thanks.

    Lots of cross posting...
    Check the position of the edge of the cropped frame. I had a problem when it wasn't dead on the spine and the frame had the shadow applied...
    Further investigation pasting the shadowed frame into another and cropping that reproduces your error, but good news, I think. If you select the cropped frame and pick a proxy point that is supposed to be on the spine, then subtract an infinitesimal amount, like .0001 from the x coordinate to move it left, or add the same if you need to move the right half right, ID will round the result back to the original dimension, but the ghost will disappear.
    At least it seems to work for me on two-page lettersize spreads working with rulers in inches.
    I think this is a bug, and I think we've discussed it before and I stumbled on the same solution last time.

  • How to create 2 checkboxs in 2 different JTable cells within 1 buttonGroup?

    Hi,
    I have a JTable with dynamic number of rows and 5 columns. What I mean by dynamic is that new rows can be added and existing rows can be deleted so the number of rows may change. As I said before there are 5 columns. The first 3 columns will always contains Strings. The fourth and fifth column will have checkboxs. I'm creating the checkboxes be specifying that the forth and fifth columns will have boolean in them. As you all know JTable converts boolean values to checkboxes.
    Here is my problem:
    I want to add these 2 checkboxes in column 4 and column 5 to a buttonGroup, s� that if I check the checkbox in column 4 the checkbox in column 5 will be unchecked and vice versa. An importent thing is that every row has its own buttonGroup for its checkboxes.
    To use buttonGroup I have to have 2 checkboxes to add them to the group for example
    buttonGroupForRow1.add(checkBox1);
    buttonGroupForRow2.add(checkBox2);
    But in my case there are no specific checkBoxes to add, I only have boolean values in 2 different cells in the JTable.
    How can I solve the problem?
    Here is a part of the code to help you undersand my problem:
    JTableToggle getPrgMemberPopupTable() {
              if (prgMemberPopupTable == null) {
                   DefaultTableModel model = new MyTableModel(10,5);
                   prgMemberPopupTable = new JTableToggle(model) {
                        public boolean isCellEditable(int rowIndex, int vColIndex) {
                             if (vColIndex == 3 || vColIndex == 4)
                             return true;
                             else return false;
                   prgMemberPopupTable.setRowSelectionAllowed(false);
                   prgMemberPopupTable.setColumnSelectionAllowed(false);
                   prgMemberPopupTable.getColumnModel().getColumn(0).setHeaderValue("Name");
                   prgMemberPopupTable.getColumnModel().getColumn(1).setHeaderValue("Subrack");
                   prgMemberPopupTable.getColumnModel().getColumn(2).setHeaderValue("Slot");
                   prgMemberPopupTable.getColumnModel().getColumn(3).setHeaderValue("Active");
                   prgMemberPopupTable.getColumnModel().getColumn(4).setHeaderValue("Passive");
                   prgMemberPopupTable.setName("prgMemberPopupTable");
                   prgMemberPopupTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
                   prgMemberPopupTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
              return prgMemberPopupTable;
        class JTableToggle extends javax.swing.JTable {
            public JTableToggle(DefaultTableModel aDefaultTableModel){
                super(aDefaultTableModel);
            public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
                // toggle is true in the case where the control key is pressed, i will invert that case.
                toggle = !toggle;
                super.changeSelection(rowIndex,columnIndex,toggle,extend);
         class MyTableModel extends DefaultTableModel{
              public MyTableModel(int a, int b){
                   super(a, b);
              public Class getColumnClass(int index){
                   if (index == 3 || index == 4)
                        return Boolean.class;
                   return super.getColumnClass(index);
         }Grateful for all help
    //Roomi

    Thanks for your help.
    2 requirements has to be fulfiled here:
    Req.1. A member is selected. The memeber is selected either by checking Active or Passive checkbox
    Req.2. Every selected member is either Active or Passive.
    My solution is build on the ide that when you check the active checkbox, then that member is selected and its is an active member. If the passive checkbox is selected then it is a passive member.
    The thing is, not every member in the JTable is selected, only those who are relative to that specfic case are selected.
    Let's say that I have 10 members in my table (which means 10 rows). Then I can select for example the second and fifth members as an active members and the seventh member as a passive one. That means only those members are selected (Req.1.). And (2 and 5) are actives and (7) is passive (Req.2)
    But lets say that I change my mind, and decide that the seventh member should be active and not passive. Then when I modify the selection and check the active checkBox (on column 3) the passive checkBox (on column 4) should become unchecked.
    Camickr, with your suggestion I can not distinguish between if the member is passive or it is not selected at all.
    Even if I use JRadioButtons instead of JCheckBoxes the problems still the same, 2 different JRadioButtons (or JCheckBoxs), both of them are in seperate columns (seperate cells), how can I add them to one ButtonGroup? Or let me refrase the last sentence (question), How can build up the solution so that when one of them is selected the other one is unselected. If I don't use ButtonGroup and have to build my own buttonGroup then I have to start thinking about mouse listner, and where the mouse click to plase, ...etc which is a lot of work for a simble thing to do.
    Unfortuntly I cannot change the layout either, I'm stricted to this layout by the company.
    //Roomi

  • Color appearing differently in different Adobe CS5 applications

    Hi,
    Can anyone tell me why color tends to appear different on screen in different Adobe applications, even if I have synchronised the color settings for CS5 applications?
    The following image provides an example, where you can see the same image viewed in InDesign (top left), Bridge (top right), Photoshop (bottom left) and Acrobat (bottom right).
    All the CS5 applications are set to the "Europe General Purpose 3" color setting, and the image has the CMYK profile Coated FOGRA39 (from "Europe General Purpose 3"). The PDF was exported from InDesign with the "Press Quality" preset.
    As you can see it appears quite similar in InDesign and Bridge, but really different in Photoshop and Acrobat.
    Thanks,
    Eivind

    Hi, I thought you might be Norwegian
    I just recently bought the monitor, and since it comes calibrated from the factory (according to Dell) I'm sticking with factory settings so far. I do have a calibrator however. The monitor profile doesn't seem to be the problem though. When checking on my MacBook Pro screen it's the same problem.
    Colors seem slightly more consistent after I flattened the PSD file and saved it as a JPEG, even if the color settings are still the same. Note: I have messed with the color of the image since the last screen grab, but it is the same version of the image in all application windows in the screen grab below.
    Annoying that you can't trust a layered PSD to come out right. When working with the layered PSD it also made a huge difference when I changed the InDesign export option from regular "Press Quality" to "Press Quality" with the PDF/X-4 standard activated. Is there any good explanation for this?
    I'll try changing the CMYK profile settings and see how that turns out.

  • Why does my color look so different in CS5 compared to CS4?

    Hi everyone,
    I am currently working on a document in InDesign CS5...have placed some CMYK artwork that I created in Photoshop CS5. All of my color settings are synchronized. Why does the color in the artwork look SO different compared to Photoshop? If I place the same artwork into InDesign CS4, everything matches as it should (once again, all applications use the same color settings/are synchronized).
    I am completely baffled...what am I missing? Is there another setting I have missed out on within InDesign?
    Thank you,
    Christine

    Okay....you are not going to believe this!! Perhaps this is a bug or perhaps this is a one-time-mystery-of-the-unexplained thing.
    I went into my desktop version of CS5 and loaded completely different color settings...pressed okay, then went BACK straight away and reloaded my usual [custom] color settings and all suddenly looked PERFECT. [I am going to have to verify this when I go into work tomorrow as I just tested via remote login so am looking at things via my macbook screen. The color difference was VERY noticeable at first between the two ID versions on my desktop so I was able to easily tell. Now they look the same.
    All in all, than you SO much for your help (so this was *not* a waste of time). All this troubleshooting really helped me a lot as to what to look for in future similar instances.
    Christine

  • AVI length different in CS5 than CS4, GSpot, Media Player, etc

    Hi folks,
    I'm not quite a complete neophyte but close so my apologies if I've missed something obvious.
    I've just upgraded to CS5 (5.03) and am encountering a puzzling situation. I'm have a set of Cineform AVIs (codec version 6.9.3.530) converted from 2 different camera's (one creates .mts files and the other .tod) and while the final avi's from one camera (.mts source file) seem to be working fine, files from the other will only report just over 2 minutes in lentgh. Actual time is better than 16 minutes.
    Not working within a sequence yet, just looking at the file in the Project window, Source monitor and properties.
    AVI's in question play fine in Premiere CS4, VLC, Media Player, etc. Everything looks to be alright in GSpot (correct length reported, plays fine). Interestingly GSpot reports 24,346 frames and CS5 reports 12173 keyframes, 12173 delta frames ... same I think?
    To sum up ...
    Cineform AVIs created from 2 different source file types (mts and tod) during the same conversion batch session (same setttings).
    Both sets of AVIs work fine in CS4 and other apps
    AVIs beginning life as MTSs working fine in CS5
    AVIs starting as TOD are only about 2 minutes long in CS5 but lengths are fine elsewhere.
    Any ideas or other information I could provide to help solve this?
    Thanks much,
    Lee

    Nevermind ... not that simple apparently. I managed to get one of the avi's in the CS5 project created automatically when opening the original CS4 project to show the entire contents but can't replicate the behavior to another project using the same avi. Here are the media start, end, duration and video in, out duration values for the file. Viewing the avi in the source monitor I can see the full 16+ minutes. Odd disconnect between the 2 sets of values.
    Any idea would be great!
    Thanks,
    Lee

Maybe you are looking for

  • Rebuilding spatial indexing fail after patch 9.2.0.8.0

    Hi! I did apply patchset, and after i did try to set NLS_LANG=American_America.CL8MSWIN1251 sqlplusw ...... SQL> alter index XXXX.YYYYYYYY_g_idx rebuild; -- <- Russian name alter index XXXX.YYYYYYYY_g_idx rebuild ERROR at line 1: ORA-29858: error occ

  • Creating Task in a Project of Project Server 2013 - Exchange 2013

    Hi, We have made an integration between Project Server 2013 and Exchange 2013 for the tasks of user. It's working fine but I've got a little question. Is it possible from Exchange to create a task in a specific project of Project Server ? Because whe

  • Automatic Transfer Order for GR from External vendor and from Process Order

    Hi Expert We need to implement the logic for automatic transfer order, the Idea when we Receive the Goods from Vendor and while posting goods via Migo we want that the system create automatically the TO. the same approach to be implemented for GR fro

  • Header on first page, not on others

    Hello, Does anyone know how to get a header to appear on the first page of a document, but not on the rest? Using section breaks, I can get the header to appear on all pages EXCEPT the first, but not the other way around. I've really played around w/

  • "Saved Optimized As" images appear pixelated - PS7.0

    I am using Image Ready for PS7.0 to create a mouseover effect.  Mouseover the smaller images and the picture in the middle changes to the large view of that picture.  The starting pictures have no/little pixelation.  However, after I finish slicing m