I am building a form that will output text into the chart, but I want the text to be customizable. I have some text components built for the customized versions, and I'd like to pull them into a variable in VFE. I can't seem to figure out how, or if this is possible.
Does anyone have any insight into this?
Sure. It depends on how you want to define the variable. For example this is a simple text file:
{
gmyvariable = "something"
""
}
Then you can pull the text file into the form by doing this:
{! ADD_TEXT_COMP('Enterprise','myTextFile')}
At this point you can refer to gmyvariable in any of your functions and it should return "something". If you want a document variable to be set as the value for gmyvariable on form load you could do something like this:
{! document.value = gmyvariable}
If it doesn't matter if your document variable is set as what you have defined in the text component on form load you can simply define the document variable in a similar way when you call it in a function when the user does something in the form. I hope this helps.
Brad
That's not really what I'm looking for. what I was hoping to have was the text component parsed and filled in, then the resultant text put into a string, akin to this:
myvar = INSERT_TEXT_COMPONENT(...)
then instead of the resultant text being put into the note, instead it's in the myvar variable.
I found a way around this. It works, but is not nearly as flexible as I'd like.
Thanks.
Hello rcarolus,
Would you please share your solution to passing the contents of a text component into a document variable (if I'm understanding your post correctly)?
This sounds like something I am trying to accomplish,
I developed a way to format text into a nice table, with wrapped text in cells, using a text component. This allows for the use of proportional fonts, and generally looks nicer than the traditional method. But, when I try to call the text component from the form that corresponds to its correct placement in the note, it keeps writing the resulting text component to the very end of the chart note. So, I'm trying to figure out a way to force the writing of the resulting text component into a specific place in the chart note. Hopefully, this makes sense.
Perhaps your technique of using a document variable would do the trick. So, if you are willing to share you MEL, I would appreciate it.
Bentley
Cascade Eye Center
Oregon
I ended up scrapping text components and building the text from hand, so my solution wouldn't help you.
You may want to take a look at add_text_component instead of insert_text_component, I think the add_ gives you more control over placement.