cancel
Showing results for 
Search instead for 
Did you mean: 

generating UI element by coding

Former Member
0 Kudos

Hi

I have abutton as soon as i click it a button need to be displyed..i need how to gereate a button by coding .

Thanks

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create two buttons at design time lets say buttonA and ButtonB.

Create a context attribute of type "Visibility"(com.sap.ide.webdynpro.uielementdefinitions.Visibility) lets say "Visible"

Bind this attribute to "visible" property of ButtonB

In the DoInit method set the visibility to none , so that its not initially visible


public void wdDoInit()
  {
    //@@begin wdDoInit()
	  wdContext.currentContextElement().setVisible(WDVisibility.NONE);
    //@@end
  }

Create action handler for buttonA

Make the button visible using the following code


wdContext.currentContextElement().setVisible(WDVisibility.VISIBLE);

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ayyapparaj thanks for you reply, i want Ui element generated by coding not by using Visibilty .....

Thanks

rahul

Former Member
0 Kudos

Hi,

Following is the code to do this



  if(buttonClicked) // this is to check when to create the button, make this variable true when first button is pressed.
	  {
		  IWDButton button = view.createElement(IWDButton.class);
		  IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("<Your Attribute>");
		  button.bindText(attributeInfo);
		  
	  }

Did you searched the forum?

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rahul,

/people/ulrich.waiditschka/blog/2007/11/28/dynamic-user-interface-generation-in-web-dynpro-for-java--use-and-implementation

check this link it will be useful , it explains Dynamic User Interface Generation in Web Dynpro for Java - Use and Implementation

Regards,

Sam Charles J.