on 04-19-2007 9:05 AM
Can anybody tell me how to customize the dimensions of input field UI element. With my requirement I cannot go for TextEdit element as it cannot support the requestFocus() method to bring the cursor when user clicks on the button. The height and width properties are not editable. How else can I customize the dimensions.
Kind Regards
Srinivas
hi,
oops this is strange but if you write the same code of requestFocus() in wdDoInot(), it will give you cursor in textedit,
so if you can go ahead with wdinit(), then it will solve the problem,
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That nice!
How you get access to UI control in wdDoInit???
The better option is to use
IWDViewController.requestFocus(
IWDNodeElement nodeElement,
IWDAttributeInfo attribute
)
where element and attribute correspond to element and attribute displayed IWDInputField and IWDViewController is in fact wdControllerAPI of view. Worth to mention that this method may be called from any controller code like wdDoInit or button action handler.
Valery Silaev
SaM Solutions
Hi Sirinvas,
Have a Look at Size,Height,width properties of your Input Field.
Regards,
'Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
you can create a context variable of type iwdtextedit,
in wdDomodify(){
wdContext.currentContextElement().setteUI((IWDTextEdit)view.getElement("textedit"));
}
in button action
wdContext.currentContextElement().getGg().requestFocus();
but this will also highlight the text edit not cursor placed in.
regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the bad advice ..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Follow the steps below to get focus to TextEdit.
1. Declare static variable and initialize to false.
2. On click of button, make it true
3. In modify view, check if variable is true, use requestFocus() method.
Note: TextEdit control gets focus but cursor will not be placed in the control and thus user needs to click on the control to enter text. Therefore this approach still fails.
Best Regards,
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
You can do the following:
1. Define a static variable of type IWDTextEdit at end of the View Implementation.
//@@begin others
static IWDTextEdit l_TE;
//@@end
2. In wdDoModifyview write this.
if(firstTime)
{
l_TE = (IWDTextEdit)view.getElement("<ID of Text Edit UI element>");
}
3.In your action for the button, write this.
wdContext.currentContextElement().setText_edit("<Add Your Notes Here>");
l_TE.requestFocus();
Text_edit : Context bind to value property of TextEdit UI Element.
Hope it helps.
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah and even in production it may cause problem....
Valery,
it gives strange behaviour, putting same code in init() method set focus to the TextEdit but if same code gets executed in button action it just highlights the TextEdit UI element.
Shiva, TextEdit gets cursor placed in it , but if the code gets executed in init(), otherwise we need to click it.
regards
Message was edited by:
Abhijeet
Abhijeet,
If it works from wdDoInit but not from action handler then it's definetly WD bug.
Check SAP Service Marketplace for available pathes to your NW version and if they didn't solve this issue then submit a bug to CSN.
Valery Silaev
SaM Solutions
Hai ,
You can resize the input field by using size property,
but yu can't change the height of the input field.
regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bad advise.
"size" property of IWDInputField is deprecated, also it affects only height of letters previously, not width of control.
So in brief it is impossible to change height of input field, but it's possible to change it width -- either via "width" property in percents or pixels or via "length" property in characters (default is 20 characters). "width" always overwrites "length".
Valery Silaev
SaM Solutions
Hi Valery,
Thanks for your reply. How do I make the request focus on the textedit UI element when user clicks a button.
I have tried the following code in the doModify method:
TextEdit addNotes = (TextEdit)view.getElement("txe_activity_notes");
addNotes.requestFocus();
But still I cannot get the cursor in the textedit area on clicking button.
Thanks and Regards.
Srinivas
Srinivas,
Say you are displaying "MyAttribute" attribute from "MyNode" node.
Then put the following in <b>button action handler</b>:
final IWDNode myNode = wdContext.node<MyNode>();
wdControllerAPI.requestFocus(
myNode.getCurrentElement(),
myNode.getNodeInfo().getAttribute("MyAttribute")
);
Valery Silaev
SaM Solutions
Message was edited by:
Valery Silaev
Hi Srinivas,
As far I know, TextEdit do support requestFocus() method. You can use as follows in doModifyView() method.
TextEdit te = (TextEdit) view.getElement("name");
te.requestFocus();
For Input field, you can directly change width property but not height property.
Thanks.
Best Regards,
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shiva Kumar,
Thanks for your reply. I tried your code:
TextEdit te = (TextEdit) view.getElement("name");
te.requestFocus();
It doesn't have any effect when I click the button. I still wonder, how should I relate the user action with the doModify method. Because the cursor has to be placed in the textedit area upon user action.
Thanks and Regards
Srinivas
hi Shrinivas,
try putting width property of 100% or 50%, it will alter the width of input field.
same way you can adjust that in matrix layout by setting matrillayout propery's width in terms of %
sure it will work
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
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.