none
Bindings is getting Removed for Table RRS feed

  • Question

  • Here is my scenario

    1.I need to add bookmark for the table cell,so i decided to create one Text BInding content control,Then I added the table binding control inside the Text Binding Content control,so using the Open XML (coercionType: "ooxml" )

    2.I decided to get the openxml for the Table binding control for adding the bookmark (I extracted the OPenXML from getDataSync Method),I added the bookmark tag inside the XML which I got from the getDataSync method,After adding the bookMark tag for the table

    3.I used SetDataSync method to set the OpenXML,when I do so the bindings are removed for the table,(i.e i am loosing the binding for the table,i.e It has removed the binding for the table,It places the plain table).

    Can anyone help on this scenario pls...I have struck with this...

    Monday, February 9, 2015 5:30 PM

All replies

  • Hi Deepak-G,

    As I'm not quite familiar with Apps for Office application, I'll escalate your question to some other engineers who have experience. This will take some time, so please be patient. If there're any updates we'll come back and give you a response.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 10, 2015 10:21 AM
    Moderator
  • I thanks for the reply..Surely I will wait for this...but this is the major scenario....we need the solution for this...

    Thursday, February 12, 2015 5:13 PM
  • Hi Deepak,

    It is a little difficult for me to understand your scenarios according to your description. Would you mind providing a sample project and sample document through OneDrive to help us understand your scenarios?

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 13, 2015 2:55 AM
    Moderator
  • I have uploaded the code to one drive...here is the link

    https://onedrive.live.com/redir?resid=AC13FB5219C13126!373&authkey=!APxbF470V75cCE4&ithint=file%2crar

    Steps to reproduce:

    1.Click the "Create content control button" to create the Text Binding.

    2.Create table (3 cloumns and 5 rows) Inside the content control and then "Create Table Binding".the table bindings will be created for the table that you selected .

    3.Click the button "GetandSetXML for ContentControl" to get and set the XML.

    4.Once after the this, you can notice the Bindings for the table is getting lost.

    Do let me know if u need more understanding on this scenario


    • Edited by Deepak-G Wednesday, February 18, 2015 9:14 PM
    Wednesday, February 18, 2015 9:13 PM
  • Hi,

    Thanks for the detail information, and I can reproduce you issue by using the sample you post.

    As far as I know, in the Word Application, the binding is implemented through the content control, in this case, the table content control is inside the text content control, so when you resetting the data of text content control, the binding information will be also lost (just like removing the table content control and inserting a new table without binding).

    To work around this issue, I suggest you creating the content control separately (create the table outside the first text content control).

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 19, 2015 4:50 AM
    Moderator
  • hi Jeffrey,

    Thnaks for your reply,I did that too if we place the table binding outside the content control,if we get and set the OOXML for the table binding ,i am getting the error.

    "The type of the specified data object is not compatible with the current selection."

    To Reproduce this issue,

    1.Go to Home.Js File

    2.Go the the function tableSelection()

    3. the code you have has (asyncResult.value[i].type == "text") and chnage that to (asyncResult.value[i].type == "table") .TO debug and to find the error,n keep the breakpoint "setDataAsync" in  tableSelection.

    4.Run the appplication,Create table (3 column and 5 rows),and click the Create Table Binding Button.

    5.Then click "GetandSetXML for Content Control" button,it hits the break point and you can caputrue the error in function "asyncResult3"

    i am getting this error ,"The type of the specified data object is not compatible with the current selection."

    can you help me on this...

    Thursday, February 19, 2015 4:06 PM
  • somebody from Microsoft team should reply on this....
    • Edited by Deepak-G Tuesday, March 3, 2015 5:28 AM
    Tuesday, March 3, 2015 5:28 AM
  • Hi,

    I can reproduce your issue by following your steps, it is caused by setting the open xml data to a table binding, as the error message described, “The type of the specified data object is not compatible with the current selection”.

    To update the data in table binding, you should use the TableData object.

            var testTable = "";
    
            Office.context.document.bindings.getAllAsync(function (asyncResult) {
                var bindingString = '';
                for (var i in asyncResult.value)
                {
    
                    //I am getting internal error if set the if loop for "table".
                    if (asyncResult.value[i].type == "table") {
    
                        Office.context.document.bindings.getByIdAsync(asyncResult.value[i].id, function(asyncResult1) {
    
                            if (asyncResult1.status == "succeeded") {
    
                                asyncResult1.value.getDataAsync({ coercionType: 'table' }, function(asyncResult2) {
                                    if (asyncResult2.status == "succeeded") {
    
                                        var myTable = asyncResult2.value;
    
                                        // update the value
          
                                        myTable.rows = [['Kim-new', 'Abercrombie', 'A'], ['Junminu-new', 'Hao', 'C'], ['Toniu-new', 'Poe', 'B']];
    
                                        asyncResult1.value.setDataAsync(myTable, { coercionType: 'table' }, function (asyncResult3) {
                                            if (asyncResult3.status == "failed") {
                                                var result = asyncResult3;
                                            }
                                        });
                                    }
                                });
                            }
                        });
    
                    }
                }
            });

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 3, 2015 6:17 AM
    Moderator
  • Hi Jeff,

    My scenario is not updating the table Data,my scenario is highlighting the particular Text with Red Color in a table cell.

    1.For this I will be taking the OpenXML part of selected binding in the table and I will be adding HighLight Tag for particular Cell..

    2.for this I am using getDataAsync with coercionType type as OpenXML

    3.I will add this Highlighting Tag in the retrived XML

    4.I will be Using the setDataAsync with coercionType type as OpenXML...If I do this I am getting error

    The type of the specified data object is not compatible with the current selection...

    To Microsoft:

    -----------------

    Microsoft Guys you should really pitch on this issue..you guys should give solution for this....

    Tuesday, March 3, 2015 10:48 AM
  • Hi Anyone from Microsoft,

    please see this issue and or respond something ..possible or not possible..can u give the email Id of JavascriptAPI team...pls help it out...

    Friday, March 13, 2015 4:47 PM
  • some should reply plsssssssssssssssssssssss
    Sunday, March 29, 2015 6:26 AM
  • Hi Deepak,

    Sorry for the late response.

    >> I will be Using the setDataAsync with coercionType type as OpenXML...If I do this I am getting error

    Based on my understanding, it is because the original binding type is table, but setting data type is OpenXML, this is why the “not compatible” error occurred.

    About how to set the cells format in tables, for Excel, we could use tableOptions to achieve this goal.

    How to: Format tables in apps for Excel

    But I’m afraid the cell formatting feature is only supported on Apps for Excel.

    If this is a feature you want to include in future versions of App for Word, you can submit this feedback to Office Development Platform User Voice.

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Sunday, March 29, 2015 7:08 AM
    Moderator
  • thank you
    Wednesday, April 1, 2015 2:47 PM