cancel
Showing results for 
Search instead for 
Did you mean: 

How Dynamically control text property of LinkToUrl

Former Member
0 Kudos

Hi,

My requirement is I am fetching emai id records from

SAP/R3 and displaying in table.In table one field is

Email Id.When I am click on email id Microsoft outlook express is opening and the mail id is automatically comming to the To field of outlook express,because before binding to reference property of LinkToUrl I modified in Component context code like mailto:xyz@yahoo.com.I set reference and

text property of LinkToUrl to <context node>.<node value>.My problem is in reference and text property of LinkTOUrl mailto:xyz@yahoo.com is comming.I want in text property xyz@yahoo.com and in reference property mailto:xyz@yahoo.com should be come

Thanks & Regards

muna

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

According to Armin suggesion I created calculated

attribut(first i created one value attribute in name of calculate and set calculated property to true and ser read only to true)in context of component controller.

I added following code in getter method .

public java.lang.String getOutputCalculate(IPrivateBirthDayAppCust.IOutputElement element)

{

//@@begin getOutputCalculate(IPrivateBirthDayAppCust.IOutputElement)

return element.getAttributeAsText("BirthDayAppModel.Zbirthday_List.Email_Id");

//@@end

}

Under Outputput model node I created calculate value attribute.My component Context node structure is like

this.

Context->OutPut(Model Node)->Birthdaylist(Model Node)->Email_Id (Model Attribute).

I am mapping Component Context to View context(Result View).My view context Structure is like.

Context->Birthday(Model Node)->Birthdaylist(Model Node)->

Email_Id.calculate attribute created under Birthday.

when i am running application i got nullpointer exception.

The initial exception that caused the request to fail, was:

java.lang.NullPointerException

at com.bajaj.auto.wdp.IPublicBirthDayAppCust$IOutputElement.wdGetObject(IPublicBirthDayAppCust.java:472)

at com.sap.tc.webdynpro.progmodel.context.NodeElement.getAttributeAsText(NodeElement.java:887)

at com.bajaj.auto.BirthDayAppCust.getOutputCalculate(BirthDayAppCust.java:151)

at com.bajaj.auto.wdp.InternalBirthDayAppCust.getOutputCalculate(InternalBirthDayAppCust.java:155)

at com.bajaj.auto.wdp.IPublicBirthDayAppCust$IOutputElement.wdGetObject(IPublicBirthDayAppCust.java:474)

... 75 more

Thanks & Regards

muna

Former Member
0 Kudos

Hi Berned,

Thanks for your reply.since I am using Adaptive RFC, I am creating model and bind to component context, for mailid data only one model attribute is created and I am creating another model attribute but how i will get all the mail details in to that model attribute that i created.

Thanks & Regards

sailajit

Former Member
0 Kudos

Hi Armin,

Thanks for your immediate help. I know how to create modele node,model attribute,value node and value attribute but don't know how to create calculate attribute.

Thanks & Regards

sailajit

Former Member
0 Kudos

hi

Make it calculate true context node attributes properties.

Then automatically created getter and settermethod will be generated u can write the code inside the methods.

When make it true method structures are created inside view.

Thanks

Lohi.

Former Member
0 Kudos

Hi

In the Component controler youcan see the property of the Element calculated false/true.

you can set as true and you can see the methods as

calculatedAttributeGetter <getTest>

calculatedAttributeSetter <setTest>

you can do the calculated values in this part

See this blogs

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0c0dcacd-0401-0010-b4bd-a05...

Kind Regards

Mukesh

Former Member
0 Kudos

Create context attribute and set "calculated" = true and "readOnly" = true in the property editor.

Armin

Former Member
0 Kudos

Hi,

you need two separate values attributes in your context - one to bind it to text property of LinkToUrl and one to bind it to the reference property.

And you only add "mailto:" to that value attribute, which is bound to the reference property.

Greets

Bernd

Former Member
0 Kudos

Create calculated attribute "MailToURL" and implement getter like

String getMailToURL(I<Node>Element element)
{
  return "mailto:" + element.get<attribute-storing-text>();
}

Bind LinkToURL.<i>reference </i>property to attribute "MailToURL".

Armin