Shape property which references documentsheet property doesn't get updated when documentsheet property changes - visio

I have the following case:
I defined a user property ("User.DocProp") at the documentsheet level. I want to reference this property in a shape property cell ("Prop.SomeProp") and display the shape property as text on the shape.
This is working (I inserted a field into the shape text which points to my shape data). The value of the document property is correctly displayed on the shape.
And when I change the document property the shape's text gets updated. Awesome!
BUT this (update of the shape's text after change of the document property) doesn't work anymore when I have multiple pages each with the same kind of shape as before. When I now change the property on the documentsheet only those shapes get updated which lay on pages that I have navigated to before (since I opened the drawing). On all other pages the shape text will show the old value of the document property. Only when I directly enter the cell in the shapesheet by pressing F2 and leave with ENTER the text will get updated.
I tried several formulas in the shape property with no avail:
=TheDoc!User.DocProp
=SETATREF(TheDoc!User.DocProp)
=SETATREF(TheDoc!User.DocProp,SETATREFEVAL(SETATREFEXPR()))
I can't find a method to force recalculation of formulas neither. What am I missing here?
Screenshot from test drawing

Related

Visio - How to use the same shape property for many shapes

I have created one master shape with many properties. In the "Define Shape Data" windows of the master shape (of the document stencil), one of the properties (masterProp) is a variable list (so with a list of allowed values).
Is it possible to re-use the list of values allowed for this property (masterProp) to define the format of another property of type variable list in another master shape so that the list of values has to be maintained only once ?
Maybee is there a way to set up "lists" in Visio and link the expected/allowed values (format field) of a property to this list (without using excel) ?
Thanks for your advises,
Is it possible to use the same property (masterProp) in another master
shape to inherit the same allowed values? Or is it possible to link
the values of another property of type fixed list in another master
shape to the values of this masterProp property ?
You mean mastershape in document stencil or in external stencil ?
You can refer to some cell of mastershape in document stencil
To reference a cell of
Use this syntax
Example
A master
Masters[MasterName]!SheetName!CellReference
Masters[Gear]!Shaft!Geometry1.X1
About Cell References
Well, Thanks to #Surrodate, this is the correct way of doing this:
Add a user-defined cell in the ShapeSheet of the document (or the page)
Open the master shape for editing
In the master shape, open the shapesheet of the master shape and go to the section of the Shape Data
In the Format column, refer to your user-defined cell. Begin typing with a "=" otherwise it takes your entry as text (even if it recognise your data ...). To refer to the document, begin with =TheDoc!User... if your data are in the page, begin with ThePage!User... Do not forget to set the type of data to 1 or 4 (in case of list).
Ok, I found the shapeSheet of the Page-1. I added a user-defined
section, then a cell named "User.Softwares". I set the value to
="Soft1;Soft2;Soft3". Correct for list ? Then in the field "Format" of the "Define Shape Data" windows in have written
"Page-1!User.Softwares". Is that the correct way to refer to the
page-1 ? When I click on the property of a shape, it proposes the text
"Page-1!User.Softwares" and not the value of the user-defined cell in
Page-1 ... What is the mistake ?
You must also change Type field ! If in this cell stores 0, it mean "String". if cell value is 1 it mean Fixed list.
You must write Page-1!User.Softwares, without quotation marks !

Set backend title for Mask-Elements in Typo3

I have a Typo3 server. On that I created some different content elements with mask.
In this elements there are often repeating content, like texts or other stuff.
So the editors make a new element in the backend, there they can add a headline and as much text parts as they want.
Often it looks like this:
Thats good, the editor can see a "preview" of the textparts. In this example "Karriere,Partner...". This naming happens automatically.
My Problem is, some times there arent any titles. Its always "No title". As an editor its quite hard to find the right dropdown to edit some stuff, you mostly have to open all dropdowns and search for the right one.
Its look then like this:
In both elements there are some string inputs that are very good for the title.
So my question is, how is mask gonna choose the title? Its not the first string input.
And secondly, can I tell Mask that they have to choose input field XYZ as title?
Heyo
Yes, you can tell Mask which field to use as a title for inline elements (like repeating contents). When you're setting up a new Mask element, right below the "Label" field of the repeated inline element, there is a field "Field that should be used as label for inline element (starting with tx_mask_)". This will be used as the title that is displayed in the backend. In the placeholder of that field, it explicitly says that "If empty, first field is used".
So, if your inline element has a field "my_awesome_header" which you would like to use as the title in the backend, set the above to "tx_mask_my_awesome_header".
I am not certain as to why it does not display anything in your second example. It might be that either the first input field is not a string, or the first input field is a string but it is empty.
I hope this helps. Let me know if you need further clarification.
Edit: Since that question came up, it should be possible to set a static default title to the containing Mask element using mod.wizards.newContentElement.wizardItems.mask.elements.[name of the mask element].tt_content_defValues.header = My awesome static title. As I said in the comments, though: I always give my Mask elements a header field and let editors fill that in.

Visio - How to access a shape parent's custom property?

I have grouped 3 shapes (simple square boxes) together. In each of those shapes, I would like to add a field that will display the value of a custom property defined in the "parent" shape (ie: the group).
I know that if the property was directly bounded to the shape I was adding the field to, the formula for that field would simply be: "=prop.MyProperty".
I've looked for something like: "=parent.prop.MyProperty" with luck. Any clue?
Although there nothing like "parent", you can use shape id directly. You need to find the ID (NNN) of the parent shape (i.e. of the group shape), and then use it in the child shape using the syntax like this:
=Sheet.NNN!Prop.MyProperty
The ID of the shape can be found using drawing explorer window (it displays shapes with ids), or "Shape Name" button on the "Developer" tab, ID() shape sheet function on the group (parent) shape, or shape.ID property VBA code.
If you are using VBA there is a Parent property.
IF VSOShp1 contains VSOShp2 and VSOShp2
Debug.Print VSOShp2.Parent
will show the name of the parent VSOShp1.
Debug.Print VSOShp2.Parent.ID
will show the sheet id of VSOShp1.
John...

Text not fitting into form fields (iTextSharp)

I created a .PDF file using Adobe Acrobat Pro. The file has several text fields. Using iTextSharp, I'm able to populate all the fields and mail out the .PDF.
One thing is bugging me - some of the next will not "fit" in the textbox. In Adobe, if I type more that the allocated height, the scroll bar kicks in - this happens when font size is NOT set to auto and multi-line is allowed.
However, when I attempt to set the following properties:
//qSize is float and set to 15;
//auto size of font is not being set here.
pdfFormFields.SetFieldProperty("notification_desc", "textsize", qSize, null);
// set multiline
pdfFormFields.SetFieldProperty("notification_desc", "setfflags", PdfFormField.FF_MULTILINE, null);
//fill the field
pdfFormFields.SetField("notification_desc", complaintinfo.OWNER_DESC);
However upon compilation and after stamping, the scroll bar does not appear in the final .PDF.
I'm not sure if this is the right thing to do. I'm thinking that perhaps I should create a table and flood it with the the text but the documentation makes little or no reference to scroll bars....
When you flatten a document, you remove all interactivity. Expecting working scroll bars on a flattened form, is similar to expecting working scroll bars on printed paper. That's why you don't get a lot of response to your question: it's kind of absurd.
When you fill out a rectangle with text, all text that doesn't fit will be omitted. That's why some people set the font size to 0. In this case, the font size will be adapted to make the text fit. I don't know if that's an option for you as you clearly state that the font size must be 15 pt.
If you can't change the font size, you shouldn't expect the AcroForm form field to adapt itself to the content. ISO-32000-1 is clear about that: the coordinates of a text field are fixed.
Your only alternative is to take control over how iText should fill the field. I made an example showing how to do this in the context of my book: MovieAds.java/MovieAds.cs. In this example, I ask the field for its coordinates:
AcroFields.FieldPosition f = form.GetFieldPositions(TEXT)[0];
This object gives you the page number f.page and a Rectangle f.position. You can use these variables in combination with ColumnText to add the content exactly the way you want to (and to check if all content has been added).
I hope you understand that:
it's only normal that there are no scroll bars on a flattened form,
the standard way of filling out fields clips content that doesn't fit,
you need to do more programming if you want a custom result.
For more info: please consult "iText in Action - Second Edition".

add row to refreshingView without repainting entire refreshingView

We have a refreshingView<shirt> (contained inside a border) set up and outside of the refreshing view we have an ajaxLink that adds a new shirt object to the list that backs the refreshingView. The refreshingView contains textFields and dropdowns for the user to enter information in about the shirts.
Inside the ajaxLink we add a shirt to the list and then add the entire border to the target of the ajaxLink, thus refreshing the border. The problem occurs when you add a row and fill out the information ( shirt color, size, style, etc. ) and add another shirt. Another row for a new shirt is added, but at the same time all the information that was inputted about the first shirt is lost.
Any ideas on how to retain the information of the previously entered shirts?
The previous data is lost, because a refreshingView discards all Items (and the models containing the data) after each rendering.
You can set an ItemReuseStrategy:
refreshingView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
Another, more involved way is to only redraw the newly added row. See the answer here: Can I add an element to a RepeatingView without refreshing the latter?