on 08-20-2004 4:32 PM
Hi
The following code retrieve label string for a field.
<i>String fieldLabel =
this.wdContext.getNodeInfo().getAttribute(fieldName)
.getSimpleType().getFieldLabel();</i>
As far I understand, it will get label property of the data type defined in the dictionary.
But if we are developing an input form, there is another label, usually defined with a label element and relation between this label element and an input field (label for property).
So, I would like to know if it is possible to navigate from the context element, to the input field, and finally to the label, in order to get the text property.
This would be useful when we don't use data dictionary, or when the label used in the layout is different from the label in the dictionary.
I know it is possible to change the label property of the simple type during runtime (below):
<i>wdContext.getNodeInfo().getAttribute("EMailAddress")
.getModifiableSimpleType().setFieldLabel("E-Mail Address");</i>
Thanks.
Message was edited by: Ronaldo Costa
Hi Ronaldo,
> As far I understand, it will get label property of
> the data type defined in the dictionary.
The label gets it's text (in this order):
1. by setting the text property directly at runtime or design time.
2. from the context attribute bound to the text property of the label.
3. from the fieldLabel property of a Simple Type, if the labelFor property of the label is set to an UI element which is bound to a context attribute having a simple type.
4. from the name of an context attribute, if the labelFor property of the label is set to an UI element which is bound to a context attribute having no simple type.
5. from nowhere, if none of the above conditions are true (stays empty).
> But if we are developing an input form, there is
> another label, usually defined with a label element
> and relation between this label element and an input
> field (label for property).
>
> So, I would like to know if it is possible to
> navigate from the context element, to the input
> field, and finally to the label, in order to get the
> text property.
No, there's no "direct connection" between an input field and the label of it. You would have to make a search through all labels of a view, if they are the label for an UI element, which has been bound to an attribute of a specific simple type (or not) and then check, if their text property has been bound or changed. But since you can't iterate through the view elements of a IWDView, this is not possible.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ronaldo,
You are thanking a poster for his answer.
Please next time also give him points.
See: /people/mark.finnern/blog/2004/08/10/spread-the-love
This time I did it for you.
Remember: When you ask a question you also assume the responsibility to assign points.
Please check your other questions and if the answers were good.
Spread the love and give some points.
Thanks in advance, Mark.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.