cancel
Showing results for 
Search instead for 
Did you mean: 

"required" fields and writing with CAPS

Former Member
0 Kudos

Hi, Ive got two issues I have problem to pass:

1. When I set field state to "required" it shows a little red star on right side of the label. Problem is that it appears on part of inputfields, not everyone where I have set "required". I need that star near every required field. Star is not show in case of RadioButtons and DropDownBoxes as well and I would like to have it here too. Can I do something to make them appear in such case?

2. I need to make almost every inputfield to have required Large Marks only, no error saying "write with caps lock on", I need it without pressed caps lock nor Shift. Even if someone writes "hello" I want it to appear "HELLO". Is there any way to do that?

If you could refer to any of those two points I would be gratefull. Regards, Balmer.

Edited by: Balmer on Mar 18, 2008 11:08 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you set the label for the RadioButtons and DropDownBoxes ?

2. I need to make almost every inputfield to have required Large Marks only, no error saying "write with caps lock on", I need it without pressed caps lock nor Shift. Even if someone writes "hello" I want it to appear "HELLO". Is there any way to do that?

Make your attributes which are bound to this input fields as calculatted and do the code to convert them to uppercase.


To get the set method for a calculated attribute set the property readOnly false.
public void setChangeToUpper(IPrivateTestCompView.IContextElement element, java.lang.String value)
  {
    //@@begin setChangeToUpper
                 //If you want to support Internationalization make use of  toLowerCase(locale)
	  value = value.toUpperCase();
    //@@end
  }

Regards

Ayyapparaj

Former Member
0 Kudos

Hi, I did "label for" for dropdownboxes, not for radiobuttons couse they are not listed.

As for your code, I made as you told. Set to calculated then inside of created method for this Context I have wote

 value = value.toUpperCase();

. No errors were listed, does not work.

I tried to make same method as yours, then "use" it in context of inputfield but that made errors. What do I do wrong? If this needs to be done exactly in same method as yours which how do I use it with my input field context. Mine looks now like below, context surname.


 public void setPersonSurname(IPrivateProjectView.IPersonElement element, java.lang.String value)
  {
    //@@begin setPersonSurname(IPrivateProjectView.IPersonElement, java.lang.String)
	value = value.toUpperCase();
    //@@end
  }

Thanks, Balmer

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Suppose you have a node Emp and one attribute EmpName which is mapped to the input filed.

Now create an action "click" and assign it to the Inputfiled.

Now add the code:

public void onActionclick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionclick(ServerEvent)

String upper = wdContext.currentEmpElement().getEmpName();

upper= upper.toUpperCase();

wdContext.currentEmpElement().setEmpName(upper);

//@@end

After entering the value in the input filed, press enter, it will convert into UpperCase

Former Member
0 Kudos

Hi, thanks for answer. Your code does not work, no errors were listed but no action was done. After clicking enter I get "Failed to process request. Please contact your system administrator.". Plus, mark that pressing "enter" after each Inputfied is not very usefull. People will probably use mouse or more likely tab. Thanks for help, Balmer.

Former Member
0 Kudos

hi,

It is working fine for me.

Have you assigned the action "click" to the input field

Former Member
0 Kudos

error

Former Member
0 Kudos

ye it works, I had "left over" from other code stucked somewhere and that failed whole action. Do you think there is a way I could make it instead of "onEnter" lets say "onTab"? Or make enter work like tab (go on the next field).

I would like to make one Action which after binding it to the inputfield work properly with it's context. So no context name can be used in the action. Got any idea? Thanks, Balmer.


public void onActionclick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionclick(ServerEvent)

String upper = wdContext.currentContextElement().getIdontKnowWhatHere();  //to take context name from field that action is used for

upper= upper.toUpperCase();
wdContext.currentContextElement().setIdontKnowWhatHere(upper); //same as above

//@@end
}

Edited by: Balmer on Mar 18, 2008 11:54 PM