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

Making a field read only (and bound) or editable depending on some criteria

Hi,

I am using Netweaver 2004s SP15 and Adobe Lifecycle Designer 7.1 with Web Dynpro for Java.

I am generating a PDF that contains a number of fields that are bound context values attribues.

Now I know according to certain criteria if any given field will have a value....

Now if such a given field has a value then it must populate the Adobe form and make that field read-only - so it can not be changed.

However, if that field has no value.. instead I need to make it editable.

I am re-implementing the application this will be used within; and the previous version had 8 different interactive forms to cater for the 8 different possible combinations of fields that would not have values.

I would really really prefer to have one interactive form to maintain with logic in it that determines dynamically if a field should be read-only or editable. (For example I could have a boolean context node that could be used)

Am I doomed to have to create 8 different forms? Or is there a way of doing this smarter?

Thanks to anyone who can point me to the light,

Ilan

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2010 at 05:22 AM

    Hi IIan,

    Yes you are right. Your requirement is totally possible by using java script but you cannot do it by using webdynpro context node because there no option of binding a editable property of a ui element in adobe form with the webdynpro context.

    Java script you can use like this.

    For example your form design is like this.

    Body Page

    -


    Subform

    -


    Field

    so wright below code in initialize action of BodyPage.

    if(BodyPage.Subform.Field.rawValue == null)

    {

    BodyPage.Subform.Field.access = "readOnly";

    }

    Thanks & regards

    Ravindra Singh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2010 at 08:59 PM

    hmmm....

    I did a search through the forum using the phrase "javascript" and it turned out a lot posts that indicate that this should indeed be possible.

    I am boggled, the original application was developed by an Indian outsourcing company that is well respected. The developer who took over maintenance of it told me that it was impossible to change the read only nature of the fields once set at design-time.

    My search through the forum has turned up much to indicate that this design was idiotic and the "facts" I was given completely wrong.

    grrrrrrrrrrrrrrrrr... I am marking this as answered now. I will have to learn some javascript.

    Are there any caveats for using it within WDJ?

    I am assuming I can do something simple in pseudo-code.. (I will need to work out the Javascript version).

    if (hasOption1) {
      field.readonly = true;
      field.style = sunken;
    }
    
    else if (hasOption2) {
     ...
    }
    
    else if (hasOption3) {
     ...
    }
    

    etc

    (There are only actually 3 options that can change.. but that results in 8 different possible forms)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2010 at 09:03 PM

    I think its answered.. but I have changed it back to unanswered just to confirm that I have understood things properly.

    Am I right?

    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.