on 09-11-2007 3:10 PM
Hi, i want know the name of a label associated to an input. I write:
String nombre = wdContext.getNodeInfo().getAttribute(CampoFecha).getSimpleType().getFieldLabel();
but don´t work, why?
Thanks,
Hi Victor,
String nombre = wdContext.getNodeInfo().getAttribute(CampoFecha).getSimpleType().getFieldLabel();
for you to get the label of the input field in the way metioned above follow the steps below:
1. Create a context named CampoFecha
2. In your project Dictionaries>Local Dictionary>Data Type>Simple Types> Right Click and create Simple Type. You can name it as Name and the type should be string. Goto Representation tab and put the text value of the label that is displayed on your screen in the field called field label.
3. Goto Context CampoFecha Properties and specify its type to the simple type being created by us.(browse button ... at the end).
4. Bind this context to your Input Field.
Now, your above code will give you the value that you are trying to fetch.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
Do you want the Label UI element associated with Inputfield UI element?
If yes, then when you create the UI elements you must follow a naming convention
e.g. if attribute is name then
label id = name_label & inputfield id = name
Then u can search label as
IWDLabel label_name = (IWDLable)view.getElement(<name>+"_label");
As for your labelFor Query, it is used to get Inputfield name from label and not viceversa
e.g.
IWDLabel label_in = (IWDLabel)view.getElement(<label_id>);
String in_id = label_in.getLabelFor(); //retuns id of inputfield
Regards,
Smruti
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor Capi,
To fetch label name, create context value attribute "Name" and associate this with label property. You can access label name by
wdContext.currentContextElement.getName();
Regards,
Ganga.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
R you binding the text property of label to a context attribute that is a simple type?
If yes then in that simple type under representation tab you will get a field called <b>Field Label</b> and you need to set the property there after that you will get the value the way you are reading.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
Write this in WDDoModifyView()
IWDLabel lab = (IWDLabel)view.getElement("<LabelID>");
lalab.getText();
But the way you were mentioning before for that you need to bind the text property of your lable to a context that is a simple type defined in local dictionary and then follow the steps given by me in the previous reply.
Regards,
Murtuza
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.