Skip to Content
author's profile photo Former Member
Former Member

Problem with context attributes

Hello All,

I am currently experiencing some strange behaviour in my WD application so I hope any experts here can give me a hand or spot my mistake.

<u><b>Scenario</b></u>

1) View A is being initialised and by default, will display the name of the manager.

2) This name is being stored as a string attribute "tempName" in a context node of cardinality 1..1.

3) Someone then decides to change the name of the manager in View A but half way, he changes his mind and clicks on a 'cancel button'.

4) This cancel button has an action tagged to it and will then transfer the contents of the attribute "tempName" back to the UI element.

<u><b>Problem</b></u>

The problem that I am experiencing now is that for some strange reason, the name that I stored in "tempName" becomes a NULL whenever it attempts to transfer the contents back to the UI element.

To ensure that tempName is assigned the correct data, I issued a "wdComponentAPI.getMessageManager().reportSuccess("From SearchButton :" + wdContext.currentApproverInfoElement().getPrevious1Name());" so that I know for sure that the correct data is being writtena nd displayed back to me.

Hence, it is very puzzling as I have no idea whatelse may have gone wrong. Any suggestions or feedback will be greatly appreciated. Thank you.

from

Kwok Wei

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 03:26 AM

    Hi Kwok Wei,

    Your are trying to transfer the value from

    wdContext.currentApproverInfoElement().getPrevious1Name() to

    "tempName" .Is that correct ?

    Please check the databindings of the UIElement.

    Regards, Anilkumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 04:14 AM

    Hi,

    Try the following

    in the init() method write

    wdContext.currentApproverInfoElement().setApprover1Name("Anil");

    wdContext.currentApproverInfoElement().setPrevious1Name(wdContext.currentApproverInfoElement().getApprover1Name());

    In the button click write the following

    wdContext.currentApproverInfoElement().setApprover1Name(wdContext.currentNameElement().getPrevious1Name());

    Regards, Anilkumar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.