OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

checkbox value

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Sat Apr 07, 2007 10:03 pm    Post subject: checkbox value Reply with quote

Hi,
I need to hide a seccion of my text in accordance to a checkbox I defined earlyer.
I don't know how to use the value of the checkbox in the condition to hide that seccion.
I'd apreciate if anyone could help me.

Ilustraton:
option 1 [ ]
option 2 [ ]
...
Section of text to show if 1st checkbox is checked.
Section of text to show if 2nd checkbox is checked.
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Sun Apr 08, 2007 5:07 am    Post subject: Reply with quote

I don't think this is possible unless you create some glue using a macro. Is that what you want to do? How did you insert the checkbox in your document?
Back to top
View user's profile Send private message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Sun Apr 08, 2007 6:23 am    Post subject: Reply with quote

acknak wrote:
How did you insert the checkbox in your document?

I just used the forms toolbar and named the checkbox field "cruz1".
Then, in the "data" tab of the properties dialog i assigned y to the "reference value (on)" and n to the "reference value (off)".
Finaly, on the properties of the section i used as a formula to hide the section: cruz1 = n.
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Mon Apr 09, 2007 4:58 am    Post subject: Reply with quote

OK, as far as I know, the form controls are not connected to Writer's variables or conditions, which are required for hiding a section. It would be nice if they were--maybe someone else knows differently.

Typically, you simply insert a variable field (Insert > Fields > Other > Variables > Set Variable). Then, to set the variable, the user double-clicks on the field and a dialog pops up where the value can be changed. You could also use a drop-down list field instead of a plain variable, and provide selectable values, e.g. "Hidden" and "Visible".
Back to top
View user's profile Send private message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Tue Apr 10, 2007 1:04 am    Post subject: I think you are right! :-/ Reply with quote

Yes, I think you are right!
The only way I could hide the section was, like you mentioned, using a variable field. It is just not as interesting (graphicaly) as the way I was intending to do.
Wouldn't it be possible to implement this for future releases?
I already registered myself for the openoffice website, but that's way way too confusing for me. I could no even undestando where or how could I maka a suggestion!
Well, thanks anyway Wink
Back to top
View user's profile Send private message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Wed Apr 11, 2007 1:25 pm    Post subject: I still wonder... Reply with quote

I was wondering...

What if i tried to set a variable value to the same value I had set on the field? I could then hide the section based on that variable, isn't it?!
How would I do such a thing?
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Wed Apr 11, 2007 2:22 pm    Post subject: Reply with quote

Sure.

When you define (or edit) a section, there is a checkbox for "Hide" with a sub-entry called "With condition". Activate the "Hide" option and in the "With condition" entry, type: MyVariable != 0

Now, if you use Insert > Fields > Other > Variables > Set variable to define a variable called "MyVariable" with format "1234" (numeric) and value 1 (or anything but zero), then the section will be hidden. You can access a hidden section through the Navigator (F5) or the Format > Sections menu.

The "Set variable MyVariable=1" field must precede the section in your document.

The user will have to double click on the field to change the value of the variable.

You may want to use a text format variable and make the condition something like HideSection == "YES" just to make it a bit more clear.
Back to top
View user's profile Send private message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Wed Apr 11, 2007 2:32 pm    Post subject: Reply with quote

Yes, that I know, but I was wondering if it would not be possible to change de variable value using that damn checkbox...

like this:
1st - insert a checkbox (named "lalala", on value = y, off value = n)
2nd - insert variable (named "blabla", value=lalala)
3rd - hide section if blabla=y

Thanks againd you must be very patient Smile
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Wed Apr 11, 2007 2:59 pm    Post subject: Reply with quote

Well, I had a feeling that's really where you were going, and to be honest, I'm not 100% sure of the answer, but given the number of simple things that currently do not work with Writer's fields, I feel confident that it will not work. So confident in fact, that I'm not going to spend the time to try it for you Wink

You should (might? may?) be able to make a small database that holds your variables (one row, each column is one "variable") and connect that to the checkbox. You can use database fields in conditional statements, no problem. Whether a change in the checkbox would then propagate into the database and into the document fields is another question.
Back to top
View user's profile Send private message
Aquarina
General User
General User


Joined: 07 Apr 2007
Posts: 17

PostPosted: Wed Apr 11, 2007 3:07 pm    Post subject: Reply with quote

I am already trying that.
Thanks Wink
Back to top
View user's profile Send private message
foxcole
Super User
Super User


Joined: 19 Jan 2006
Posts: 2771
Location: Minneapolis, Minnesota

PostPosted: Wed Apr 11, 2007 9:15 pm    Post subject: Reply with quote

Aquarina wrote:
Yes, that I know, but I was wondering if it would not be possible to change de variable value using that damn checkbox...

like this:
1st - insert a checkbox (named "lalala", on value = y, off value = n)
2nd - insert variable (named "blabla", value=lalala)
3rd - hide section if blabla=y

Thanks againd you must be very patient Smile

I think that would assume the same availability of the checkbox to the document that the original use of the checkbox value would have provided... meaning, if you could do what you're suggesting here, you could also have done what you wanted in the first place and use that checkbox value. But the checkbox is not a document variable and the data does not exist where the document can use it... it's designed for external use.
_________________
Cheers!
---Fox

WinXP Pro SP2, OOo Portable 2.3.1, OOo local 2.4 RC4
New OpenOffice forum: http://user.services.openoffice.org/en/forum/
Manuals: http://documentation.openoffice.org/manuals/index.html
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group