Page 1 of 1

Data Binding AddIn - task pane disappears!

PostPosted: Fri Oct 15, 2010 6:27 am
by dcole
Jason,

I will double check if necessary, but I think this has a bug. When I had a fresh document open, with regular binding controls in it, I did not get any options showing in the panel. In fact, it was completely blank, and then went away after I clicked in another binding.

Also - does this still only work with rows of a table? Is it possible to repeat across the columns of the word document? Say I had a list of things I wanted to somehow repeat ,across the page instead of down, with a comma after each one or a bar between them or something.

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Fri Oct 15, 2010 11:49 am
by jason
I've documented the addin at:

http://dev.plutext.org/svn/docx4j/trunk/docx4j/sample-docs/databinding/WordAddIn_walkthrough.pdf

I think you should see something with a regular binding control (i've been starting with docx without them), but i do need to enhance the "Add CustomXML to this docx" a bit for that case:

1. although the add in is designed to handle multiple regular custom xml parts it shouldn't add an additional one (since you already have one)
2. it should go through each binding, and add an xpath to the xpaths part, and if the user has questions enabled, also prompt for a question.

I'm currently working on a Word macro to interpret the controls, so it'll be a little while before i get around to the above enhancement.

Re your second para, i've copied that to a new thread.

ps i changed the condition xpath element name to xpathref in both the Add-In (just now) and docx4j svn head (yesterday), so pls make sure you are using these.

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Sat Oct 16, 2010 1:01 am
by dcole
So I do have one other issue - when I load the plugin, and I go to create a binding - your plugin doesn't fit my screen, and I can't see the buttons for "Use this xpath" or "Clear binding" and such that show up in your documentation. And I can't seem to resize the plugin panel to get them to show unless I hide the ribbon. Any way to make that scroll?

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Sat Oct 16, 2010 7:18 am
by dcole
Just to confirm - there is something fishy here. When I work on binding a document, close Word, then re-open..I can't get the add-in to stay open when I am trying to modify the bindings, or add new ones or anything. And when I click on "Show task pane" I just get a message box saying I clicked the button.

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Tue Oct 19, 2010 12:14 am
by jason
I've published an updated Add-In with scroll bars, and which handles existing docx.

To try it point your browser at the setup.exe.

The latest nightly http://dev.plutext.org/docx4j/docx4j-ni ... 101019.jar incorporates the change in svn head of condition xpath element name to xpathref

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Wed Oct 20, 2010 1:57 am
by dcole
Still having an issue with editing an already existing file -

Steps to recreate:

Open MSWord 2007

Click on Add CustomXML to this docx

Select No for question

Create content control

click on "bind this..."

select the "yourxml" tag

give it some pathID

save/close doc

re-open. Now, sometimes i have the task pane showing, sometimes not. The button "show task pane" is greyed out. When I click on "Add Custom XML" it asks me if i want to add Another XML since there already is one. I click no, the task pane shows up.

As soon as I click into that content control box, the task pane goes away

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Wed Oct 20, 2010 8:10 am
by jason
Either don't close the document, or if you do, close Word before re-opening. (There may currently be an issue associating the task pane with the docx if you close/re-open)

Also, when you put your cursor in the content control, be sure that it is not after the last character. (It looks like it is in the content control, but as far as Word is concerned, its not. )

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Wed Oct 20, 2010 8:27 am
by dcole
I dont think it is that simple. No matter how I open/close the document..be it with or without word completely closed, you cannot edit a previously existing file with custom XML.

I clicked all around in and out of the content control - the task pane doesnt stay open. When it is open (after first clicking on "Add customxml to this doc" again), it is completely blank, and as far as I can tell never even re-loads the GUI that would come up when first associating with a document.

This is fine for creating small documents, but for complicated documents, kind of sucks to have to create it all in one sitting

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Wed Oct 20, 2010 10:23 am
by jason
dcole wrote:I clicked all around in and out of the content control - the task pane doesnt stay open.


I have never seen the task pane disappear. By design, it is blank when you are not in a content control. But it should never disappear, unless you close it.

Are there any steps you can give me to reproduce? What OS is your Windows PC running, and it is Word 2007, yes?

Are you able to try installing the add-in on a differently configured machine? (I've been developing on Win 7, and checking the install on XP)

Do you experience the problem on the sample-docs/databinding/invoice.docx (current svn copy)?

Please inspect the customxml part containing the conditions in your docx, and confirm it contains xpathref elements, not xpath elements. (In my testing, this didn't kill the task pane, but it is worth checking these are correct to eliminate this as an issue)

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Thu Oct 21, 2010 2:40 am
by dcole
Yes, it is word 2007. I am running Windows 7. I posted the steps in my previous post.

And yes, I tried to download sample-docs/invoice.docx and the content controls are not editable there with your tool. The task pane does open when the doc is opened, but the task pane immediately goes away as soon as I click in any of the content controls - also there was no conditions in my XML document. Just plain ole bound content controls

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Thu Oct 21, 2010 3:02 am
by dcole
I made a quick video showing you what happens trying to load invoice.docx

http://www.youtube.com/watch?v=jLBKEfA_iH8

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Thu Oct 21, 2010 8:57 am
by jason
Thanks for the video, that's helpful. What should actually happen at the point the task pane disappears, is that it should you info about that content control.

At this point, if you press the button on the OpenDoPE ribbon to show the task pane, does it re-appear?

I'm wondering whether you have another Add-In loaded, which is closing task panes. Pls go to Word Options > Add-Ins and have a look at your "Active Application Add-ins".

Are there any non-standard ones there? The "Manage" option further below will let you disable them; then you can see whether mine works properly.

Re: Repeat/conditional Data Binding - CHANGES

PostPosted: Fri Oct 22, 2010 1:13 am
by dcole
If I click on the OpenDoPE on the ribbon - the "Show task pane" button is grayed out and I can't click it. The only option is to "Add CustomXML to this docx" and when I click that it prompts me that there is already custom XML associated, so I click on "no" to not add another one. That makes the task pane show up, but as soon as I click in any content control, that task pane goes away again. As far as I know, there are not any other addins running that arent standard (this was a fresh install of word,a nd yours is the only add-in i have specifically added)

Re: Data Binding AddIn - task pane disappears!

PostPosted: Sun Oct 24, 2010 9:07 pm
by jason
It turns out my add-in was itself deleting the custom task pane: I have code for deleting orphaned task panes, and because your docx had "(Read Only)" in the Window title but not the task pane title, the task pane was being cleaned up.

You should have better luck with the latest version of the Add-In.

cheers .. Jason