on 06-24-2008 9:29 AM
Hello,
do you know how is it possible to set InputField length? I know how to set fix length but I need to pass the length through URL parameter.
Thanks in advance!
Regards
Zbynek
each UI properties could be binded to context attributes.
****************
IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String paramValue1 = request.getParameter("<URL Parameter name>");
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/be65751c743959e10000000a1553f6/content.htm
******************************
Regards Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created new Value Attribute in context of my View. It's called customTitleLength. Then I inserted following code into method wdDoInit() of View Class.
String prefixID = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("prefixId");
if ((prefixID == null) || (prefixID.length() < 1)) prefixID = "";
int prefixLen = prefixID.length();
if (prefixLen > 0){
int titleLen = 55 - prefixLen;
wdContext.currentContextElement().setCustomTitleLength(titleLen);
}
else{
wdContext.currentContextElement().setCustomTitleLength(55);
}
At the end I mapped InputFields' parameter Length to the attribute customTitleLength.
But it doesn't work. It seems the attribute is filled after view rendering.
Could you ensure me that the method is executed before view rendering? Or could you advice to me where could I put the code?
Thank you!
Zbynek
Hi,
Following will be an alternative approach
1) Create a calculated attribute of type integer(Ex: LabelLength)
2) in the getter of this method code as follows
public int getLabelLength(IPrivateTestCompView.IContextElement element)
{
//@@begin getLabelLength
//Use the following method in latest version
// String prefixID = WDProtocolAdapter.getProtocolAdapter().getRequestParameter("prefixId");
String prefixID = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("prefixId");
if ((prefixID == null) || (prefixID.length() < 1)) prefixID = "";
int prefixLen = prefixID.length();
if (prefixLen > 0){
int titleLen = 55 - prefixLen;
return titleLen;
}
return 55;
//@@end
}
Bind this attribute to the length property of the inputfield.
Regards
Ayyapparaj
1) create a parameter "Url" in the interface view out plug
2) generate url for the target application.
3) add parameter to the url
String url = WDURLGenerator.getAbsoluteWebResourceURL(
wdComponentAPI.getDeployableObjectPart());
url = url + "param1="+length;
wdThis.wdGetMyInterfaceViewController().wdFirePlugOut(url);
n¡k¡L
Edited by: Nikhil Bos on Jun 24, 2008 6:18 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Just try this code
Map urlParameters = new HashMap();
// get URL parameter value entered by user, stored in context attribute u2018UrlParamValueu2019. Put parameter u2018hugou2019 in the sneak preview version.
urlParameters.put("hugo",wdContext.currentContextElement().getUrlparametervalue());
if it useful give me points pls
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.