I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2011-08-04 16:15:50.015825-07 by momchil
making user-field (variable fields) visible or invisible
Hello, I tried to post this under another discussion thread but something failed during the posting process. As this may be useful to some, I allow myself to post it as a separate topic. Hi, thanks for your posts! It helped me in making user-fields visible/invisible (hidden). I have a document template in which I would like to keep user-type fields hidden, as they are not evaluated yet (custom code evaluates and updates them). But after these are evaluated and updated with values, I would like to make them visible for printing etc. Here is what I do (if this could help someone else). First, create them invisible. In my case I use setTextFields to replace simple-text when creating the field (but you could use setTextField similarly?):
$doc->setTextFields( $paragraph, "create-it-here", 'variable', name => "MYFIELD", display => 'none' # CREATE IT AS HIDDEN );
this creates(*) a field reference in the document as this:
<text:user-field-get style:data-style-name="" text:display="none" text:name="MYFIELD">create-it-her +e</text:user-field-get>
(*)Note: all user-type variable fields must be declared prior to all of this with setUserFieldDeclaration!
Then, I process the data and update the fields with: userFieldValue(), then, I want to make these visible, so I get all fields references and set the 'display' attribute on these:
my @refs = $doc->getUserFieldReferences("MYFIELD"); foreach my $r (@refs){ $r->set_att('text:display', "value"); }
It worked for OODoc 2.125 just as I needed it! The document format is ODF (.odt).
Praise be to the Lord, God, my creator who is much more wiser than me :)
(I'm very new to this, so forgive me if I don't make sense!)
Direct Responses: 13447 | Write a response
Posted on 2011-08-08 03:48:42.610219-07 by jmgdoc in response to 13443
Re: making user-field (variable fields) visible or invisible

Maybe this topic should take place in the OpenOffice::OODoc forum.
Direct Responses: Write a response