on 08-09-2006 2:49 PM
Hi,
i have radiobuttons and based on the selection parts should be shown or not. how can I do this in WD java?
Hi
You can create a context attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility.
And you can assign them to visible property of you UI elements.
You can use
wdContext.currentContextElement().set<ContextAttrName>(WDVisibilty.VISIBLE);
or
wdContext.currentContextElement().set<ContextAttrName>(WDVisibilty.NONE);
in the action of your onSelect event for radio button.
Regards,
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create value attribute as "sample"
select that "sample" value attribute->properties->
Click on type->type selection window will pop up
->Dictionary simple type ->com.sap.ide.webdynpro.uielementdefinitions->visiblity
bind this "sample" value attribute required to visible property of UI elements.
wdContext.currentContextElement().set<ContextAttrName>(WDVisibilty.VISIBLE);
or
wdContext.currentContextElement().set<ContextAttrName>(WDVisibilty.NONE);
Regards
Suresh
Thanks
How can I implement it(I made the visibility type), i have the following code in the custom controler:
Y_Tf_Process_Reasons_Input inputPR = new Y_Tf_Process_Reasons_Input();
inputPR.setMainprocesskey(wdContext.currentYtf_MainprocessPLElement().getMainprocesskey());
wdContext.nodeY_Tf_Process_Reasons_Input().bind(inputPR);
try
{
wdContext.currentY_Tf_Process_Reasons_InputElement().modelObject().execute();
wdContext.nodeOutputPR().invalidate();
}
catch (Exception ex)
{
ex.printStackTrace();
}
Hi,
Are u setting the visiblity of the UI element then bind the attribute to the UI element.
Then Set the attribute value as
wdContext.currentcontextElement().set<attribute>(WDVisibilty.NONE);
Suppoose if u bind the Mainprocesskey attribute then the type of the property should be com....uielement.visiblity
.
But the Mainprocesskey is a bapi parameter.
Why u are setting there?
Regards,
Vijayakhanna Raman
Hi,
1.Create a attribute in component Controler named textvisible with type com.sap.ide.webdynpro.uielementdefinitions.Visibility
2.Bind the attribute to the View.
3. Bind the attribute to the UIelement's Property Visibillity which you want to hide.
Check the condition which deside the visibility of that element in view .You can check it in view or component controler.
set the visibility as follows
String param=wdContext.current<node>Element().get<Param>();
if(param.equals("<value>")){
wdContext.current<node>Element().set<textvisible>(WDVisibility.VISIBLE);
}else{
wdContext.current<node>Element().set<textvisible>(WDVisibility.NONE);
}
Kind Regards
Mukesh
It says that it is not applicable for the arguments:
//@@begin onActionLeadSelectProcess(ServerEvent)
wdThis.wdGetProcessStart_CustController().getY_Tf_Process_Reasons_Input(MAINPROCESSKEY);
String param=wdContext.currentReasonsPRElement().getMainprocesskey();
if(param.equals("<value>")){
wdContext.currentReasonsPRElement().setMainprocesskey(WDVisibility.VISIBLE);
}else{
wdContext.currentReasonsPRElement().setMainprocesskey(WDVisibility.NONE);
}
//@@end
}
Hi,
Once u execute the bapi,ucan get the values from the backened
For example the mainprocesskey
.
Then use the below code
String param=wdContext.currentReasonsPRElement().getMainprocesskey();
if(param.equals("<value>")){
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.VISIBLE);
}else{
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.NONE);
}
Hope this helps,
Regards,
Vijayakhanna Raman
I have a table (first they where radiobuttons) which only needs to be shown if the bapi gives data.
_______________________________________
The first set gives an invalid expression statement.
if(param.equals("<value>")){
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.VISIBLE);
}else{
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.NONE);
}
Eoin,
a small tip: The better you describe your problem/use case, the easier it is to give a solution.
So please describe
- what kind of radio buttons are you using, single buttons or radio button group
- How does your context structure look like
- Did you bind the "visible" property of all UI elements you want to show/hide to a context attribute of simple type "Visibility"
- Do you have a suitable point in processing where to set the value of this attribute (e.g. an event handler)
As an alternative, you could use a calculated attribute.
Armin
Hi
if the bapi give the data
IPrivate<ViewName>.I<BapiOutput>Node node=wdContext.node<BapiOutput>();
int size=node.size();
if(size>0){
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.VISIBLE);
}else{
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.NONE);
}
//
Give the complete code and error message
Kind Regards
Mukesh
Hi,
If u need to show the table Visiblity the create the attribute tablevisiblity.
Bind this to table.
Then execute the bapi.
See weather any value is returned from backened.
String parm=<value from "output node">
if(parm.equals("<value>")){
wdContext.currentTableVisiblityElement().set<visiblity attribute>(WDVisibility.VISIBLE);
}else{
wdContext.currentTableVisiblityElement().set<visiblity attribute>(WDVisibility.NONE);
Regards,
Vijayakhanna Raman
I have a table and on lead select there should be apperaing an other table if the bapi gives any data.
I made a value attribute with name WDVisibilty with type com.sap.ide.webdynpro.uielementdefinitions.Visibility
This value attribute I bind to the table (Visible). In the view I used the above coding.
hi,
create one Context value attribute. give the WDVisibility type to that attribute.
bind it with the table's visible property.
check the Bapi's output node if it's size=0 then set the visibility property to
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.NONE);
otherwise set
wdContext.currentContextElement().set<visiblity attribute>(WDVisibility.VISIBLE);
have a table and on lead select there should be apperaing an other table if the bapi gives any data.
I made a value attribute with name WDVisibilty with type com.sap.ide.webdynpro.uielementdefinitions.Visibility
This value attribute I bind to the table (Visible). In the view I used the coding in the view. But the table is still visible
wdThis.wdGetProcessStart_CustController().getY_Tf_Process_Reasons_Input(MAINPROCESSKEY);
IPrivateStartProcessView.IReasonsPRNode node=wdContext.nodeReasonsPR();
int size=node.size();
if(size>0){
wdContext.currentContextElement().setWDVisibilty(WDVisibility.VISIBLE);
}else{
wdContext.currentContextElement().setWDVisibilty(WDVisibility.NONE);
}
Hi,
If the output node is nodeReasonsPR();
then
int size=wdContext.nodeReasonsPR().Size();
if(size>0){
wdContext.currentContextElement().setWDVisibilty(WDVisibility.VISIBLE);
}else{
wdContext.currentContextElement().setWDVisibilty(WDVisibility.NONE);
}
Print and see the size.
Regards,
Vijayakhanna Raman
Hi,
In ur leadSelect method just execute the RFC and then check this following code.
From the RFC node that gives ur output:
if(wdContext.nodeZ<Output node>.size()!=0)
{
wdContext.currentcontextElement.set<table visibility param>(WDVISIBILITY.VISIBLE);
}
else
{
wdComponentAPI.getMessageManager().reportException("No Values Found",true);
}
By this way u can check whether ur RFC is getting executed and if it is then the visibility will be proper.
Regards,
Nagarajan.
Hi
You set the visibility to NONE in wdInit() of the view by
wdContext.currentContextElement().setWDVisibilty(WDVisibility.NONE);
so that the table won't be visible initially.
Regards,
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eoin,
Create context attribute with type WDVisibility bind it with visibility property of UI elelment you need to gide/show. In onToggle action handler of CheckBoxGroup or CheckBox set visiblity to appropriate value.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
check the lead Selection for the selected radio button and set the visibility occording to the condition.
String selected=wdContext.current<Radio>Element().get<Param>();
if(selectes.equals("<Value>")){
wdContext.current<Name>Element().set<Param>(WDVisibility.VISIBLE);
}
Bind the visibility attribute to the UI Element
Kind Regards
Mukesh
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 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.