cancel
Showing results for 
Search instead for 
Did you mean: 

how to restrict the user to click hyperling at only one time

Former Member
0 Kudos

hi all,

in my application, iam using one table having hyperlink as one field, i want to restrict the user, not to click two times of the hyperlink, if he click the hyperlink second time he should get error message.

plz let me know how to check and give error message

regards,

sush

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sushma,

Take a static variable and in the init method, u initiate it to 0 and in the on clickevent of the URL increment it. and write a condition there if that variable greater than 1, give a error msg using IWDMessageManager followed by a return statement. Hope it helps you....

Ravi

Former Member
0 Kudos

Not a static variable.

Armin

Answers (4)

Answers (4)

Former Member
0 Kudos

ssxdfs

Former Member
0 Kudos

Hi,

Create a context attribute of type boolean, lets say "Enabled" and set its value to true in the init method.

wdContext.currentContextElement().setEnabled(true)

On the click on this Link to action UI element reset this value to false

wdContext.currentContextElement().setEnabled(false)

bind this attribute to the readonly property of the UI element.

Regards

Ayyapparaj

Former Member
0 Kudos

HI Sush,

Do one thing.created one context value attribute as visible in view ..type should beWdVisibility instead of String do as before

Click on Context atttribue as visiblr click on itgo to TYPE property of attributecom.sap.ide.webdynpro.uielementdefinitions.Visibility.(click on button goto com.sap.ide.webdynpro.uielementdefinitionsand chosse VIsibility)

Suppose you are using URLToAction as link.for that your will create one action like/.

set Visible property of URLToAction as Context attribute as visible (context attribute in view)

public void OnClick(event){

''''''''''''''''''''''''''''''

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

}

hope this will work

Thanks

jati

Former Member
0 Kudos

Just disable the link or the associated action in the action handler.

Armin