on 11-27-2007 11:01 AM
Is it possiable to set the input field to readonly in Inbound Plug ?
All you have to do is to create a context attribute called InputFieldReadOnly (type boolean) and map it to the readonly attribute of the desired InputField.
In the inbound plug you can change its value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me elobrate the requirment of setting readonly field dynamically at runtime in application...
Initially the Input Field will Not be readonly.
Once the user enter some value and click "Searc Button" the data will be populated in table in Next View.
In The Second view this Input Field will be populated with previous user entered value in read only mode.
Problem Is resolved by this ..I will will update checking this in other navigating pages
-
public void onPlugFromView1(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onPlugFromView1(ServerEvent)
wdContext.currentContextElement().setGroupReadonly(true);
wdContext.currentContextElement().setGlobalCounterReadOnly(true);
//IWDInputField inp = (IWDInputField) viewObj.getElement("InpFieldID"); inp.setReadOnly(true);
//@@end
}
Thanks to forums..
Hi,
Ya it possible. You can create the reference to the input field and set it as read-only. You can write the following lines of code onAction of the inbound plug:
IWDInputField inp = (IWDInputField) viewObj.getElement("InpFieldID"); inp.setReadOnly(true);
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Hi,
>
> Ya it possible. You can create the reference to the
> input field and set it as read-only. You can write
> the following lines of code onAction of the inbound
> plug:
>
> IWDInputField inp = (IWDInputField)
> viewObj.getElement("InpFieldID");
> inp.setReadOnly(true);
>
> thanks & regards,
> Manoj
It would not be a good idea to change it in wdDoModify
Where the mentioned code to be added.
I understand from replies this is possibale.
So,I have added a varibale called "InputFieldReadonly" in GlobalContext.
In First View The value in TextField "NameInput_1" is in EDIT Mode.
On CLicking a button page is navigated to Second View called "View2".
In View2 there is InBound plug "<b>onPlugFromView1</b>"
So i have added below code in InBound plug.
I am getting compiliation error.
I have added a Value Attribute in Global Context with name InputFieldReadonly
Please help me to identify the problem exactly..
-
public void <b>onPlugFromView1</b>(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onPlugFromView1(ServerEvent)
IWDInputField inp = (IWDInputField) <b>view</b>Obj.getElement("InpFieldID"); inp.setReadOnly(true); //@@end
}
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.