Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-04-04T15:13:59Z by mburati
JBird
JBird
51 Posts
ACCEPTED ANSWER

Pinned topic DataPage Entry / Dojo Inline Edit - Looping through affected rows OR AJAX

‏2013-04-04T14:19:13Z |
I have a requirement to allow data changes on a result set which will consist of text columns, checkboxes and drop down selects (via Lookup Tables). I am trying to experiment with just DataPage with the Data Entry option vs DataPage and Dojo Inline Edit. At the moment I am using the DataPage and Dojo Inline edit with "allow multiple edits", "edit on text selected", and "submit form". I have several questions on the correct procedure to get access to only the rows which were changed.

1. Currently, as I change multiple fields in the form and then click on one of the check marks to confirm the change the whole form gets submitted. Is this intentional? It seems they should have to click the checkmark on each field which was changed before it is submitted.

2. I would prefer not to submit the entire form and that the update happens via an ajax call behind the scenes using the loopvar. Is this possible via an event? If so can you elaborate?

3. I've gone down a different road assuming #2 wasn't a viable solution although I would like it to be. I'm trying to pass the contents of the form to a java method where I am looping through the results. The problem is that I am getting the entire form contents, not just the rows which were changed. I suppose I could create a copy of the resultset before the change and compare them but I was hoping there is a better method out there.

Open to suggestions. Thanks in advance!

Thanks,

Jay
Updated on 2013-04-04T15:13:59Z at 2013-04-04T15:13:59Z by mburati
  • mburati
    mburati
    2552 Posts
    ACCEPTED ANSWER

    Re: DataPage Entry / Dojo Inline Edit - Looping through affected rows OR AJAX

    ‏2013-04-04T14:55:39Z  in response to JBird
    You probably know this based on some of the comments there, but if you submit a form you submit the whole form (actually the browser does) and not a portion of it.

    It may be possible to hook up an HTML Event Action on change of a text field, to call (via AJAX) an action on the server that updates just that individual field. I have not tried this myself, but it seems worth a try, if that's what you're trying to do.

    The loopvar is a variable in the JSP that's active while the JSP is executing (turning the JSP code into HTML code) on the server, so it's not a variable in the browser, but you can add things to the JSP (eg, a link or an argument to an action) inside the area that the generated JSP loops over, to access a member of the loop variable (eg, the id of the row) as it's rendering each row of data (and link or HTML event reference)).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • JBird
    JBird
    51 Posts
    ACCEPTED ANSWER

    Re: DataPage Entry / Dojo Inline Edit - Looping through affected rows OR AJAX

    ‏2013-04-04T15:01:12Z  in response to JBird
    Mike,

    Just so I'm clear, what is the purpose of the inline edit without the submit form checked in the builder? I don't see how to get the data back out for processing.

    Thanks,

    Jay
    • mburati
      mburati
      2552 Posts
      ACCEPTED ANSWER

      Re: DataPage Entry / Dojo Inline Edit - Looping through affected rows OR AJAX

      ‏2013-04-04T15:13:59Z  in response to JBird
      I have to admit that I haven't used Dojo Inline Edit much at all myself as it's not a use case I've been asked to help with much, so if there are other WEF experts reading this, with Dojo Inline Edit experience, feel free to chime in with other ideas.

      According to the help:

      
      Once editing is complete, the application user has the option to cancel the changes or save the results either to the page (as a hidden input) or submit the outer form.   ... If 
      
      this input is clear, supply your own form submit to save any changed values to the server.
      


      So it looks like it was meant for those that want to use another button or Javascript to either submit the form or grab the hidden inputs and do something with them (eg, an AJAX call from Javascript).

      I hope that info helps,
      ..Mike Burati
      http://www-10.lotus.com/ldd/pfwiki.nsf/
      The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.