cancel
Showing results for 
Search instead for 
Did you mean: 

How to display case sensitive elements in an adobe interactive form

Former Member
0 Kudos

Hi Experts,

I'm not sure if this is the correct section for my problem or if I should post it in Web Dynpro section...

Out of an Web Dynpro Component I'm starting an Adobe Interactive Forms and filling it's elements by Web Dynpro Context Nodes. So long everything's fine.

Now I need to display some elements depending on cases of my Web Dynpro.

In other words for example:

if x = 1 show some elements in my interactive form,

if x = 2 don't show them but show other elements

and so on....

Is there any function in interactive forms to realize that?

I had a similar problem before, depending on Web Dynpro cases different Forms are executed and displayed as shown here

[] but in this case I need to handle with the elements of my interactive forms.....

Any ideas?

Thanks in advance,

Tan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tan,

As per my understanding, your requirement is to show/hide certain fields depending upon some condition. If you search in the forum, you will get many answers for this.

You can do this with javascript in the appropriate event in Adobe form. Try the following script:

if (X==1){ 
    field1.presence = "hidden"; 
} 
else if(X==2){ 
    field2.presence = "hidden"; 
}

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

I'm working with Web Dynpro ABAP.....or where can I implement JavaScript in my Form?

But ok, will search for it...

Former Member
0 Kudos

Hi Tan,

it doesn't matter if its webdynpro ABAP/Java.

in WD view you have the adobe component right.

in this adobe component design you need to have these 6 subsections.

So which mean you need code in the adobe form not in web dynpro.

Now in the adobe form you have 2 scripting languages formcalc & java script.

just a slight difference in syntax, its just that i feel comfort in java script.


this.presence = (field1.rawValue == 1) ? "visible" : "hidden"
this.presence = (field1.rawValue == 2) ? "visible" : "hidden"
::::::
::::::
 // for subforms 1 to 6 respectively on form load .....

Cheers,

Sai

Former Member
0 Kudos

Hi Tan,

If you are new to Adobe Forms, I would advice you to go through some documents. Adobe LifeCycle Designer provides number of events where you can write the script. In your case you can use the "initialize" or "form:ready" event to write the javascript.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi,

back again, had to handle other issues, sorry.

Just to get a little more concrete. The condition depends on the context node attributes. So if an attribute is initial, it's field should not been shown, if it's not initial, it should ne shown. There are 6 context attributes and therefore 6 fields in the form. How can I get the attributes' value?

And can I put them into the same subform or do I have to create 7 (6 conditions + blank-condition) subforms?

I put the fields (textfield and context node value) that should be shown depending on conditions in a subform. So how can I adress this subform?

I'm not so familiar with JavaScript, so please help me. I need something like:

if (context_node_attribute X is initial) {
         subform_1.presence = "hidden" ;
}

I tried it with

if ( ARB_STUNDEN.rawValue != null) {
	Beratungsstunden.presence = "hidden" ;
}

but it didn't work....

Thanks,

Tan

Former Member
0 Kudos

Hi,

it's working now.

I declared a boolean variable in WD Component which checks if there are values or not. This variable is mapped to the form und assigned to the subform. Then the coding looks like this:

if (this.FLG_1.rawValue = "-") {
    this.presence = "hidden";
}

The result is the subform (a whole row) is not shown in the form.

But there is a placeholder left at the place where the row is/was. Is there an way to realize thsi issue wthout having a placeholder left?

Former Member
0 Kudos

Hi Tan,

You don't have to declare any Boolean values in WD Component to handle this problem. Use the following script in the initialize event of the subform.

if(this.ARB_STUNDEN.rawValue == "" || this.ARB_STUNDEN.rawValue == null){ 
      this.ARB_STUNDEN.presence = "hidden"; 
} 
else{ 
      this.ARB_STUNDEN.presence = "visible"; 
}

Make the subform 'flowed' in the object pallete for removing the blank spaces after hiding the fields. But once you make the subform 'flowed', the fields in the subform will get aligned to a default position.

Hope this helps.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi Sanoosh,

thank you, the visible & hidden thing is working fine. Thanks.

But once you make the subform 'flowed', the fields in the subform will get aligned to a default position.

I'm working on this issue right now....does this mean, the position of the fields is not changeable? I have selected 'flowed' and 'left to right' but the alignment does not match my requirements and it seems that I cannot change it....

Is there a way to manipulate the order of the fields' appearance?

Former Member
0 Kudos

Hi Tan,

You can use a combination of flowed and positioned subforms to achieve this. The basic idea behind is the subform should be flowed to shrink at runtime.

Ex:

Wrap the individual fields or fields that comes in a row togather, in a single subform which is positioned as per the requirement.

Then wrap all these subforms in another subform which is flowed. In the positioned subform you can arrange the fields in the desired position and when you hide these positioned subforms, the parent subform shrinks since it is flowed.

Hpoe you got my point.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi,

thank you, you sent me in the correct direction.

I had to redesign the structure because on the form there are a lot of other elements (texts etc...).

Before I had a 'master side', under master side a 'page 1' and a subform (no. 1). In this subform I had all the elements which are displayed in the form.

Now I put all elements directly to 'page 1'. The elements (subforms) that had to be flowed are assigned to the subform (no. 1) which is declared as flowed.

So everything is working correct.

Thank you very much for your help.

Tan

Edited by: Tan Yildiz on Feb 9, 2011 11:16 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tan,

if its like you have single context for data & single Adobe component in Web dynpro view.

Then you can classify the 2 sections of data in 2 different subforms in the same adobe document.

have a flag field in context to determine which section to display.

in the adobe form on load just deterimine which sub section to be displayed and set its presence/visibility.

hope you get this, else let me know if you need more info.

cheers,

Sai

Former Member
0 Kudos

So, do I have to create different forms for each case? Right now I'm working with 4 forms, so for each of this forms do I need to differ depending on my cases. So to catch all cases I need to create for each of my forms 6 subforms (6 different cases).....is this correct?

Is there no easier way?

Former Member
0 Kudos

There you got it.

There is no need of creating 6 different forms.

Instead have these in 6 different subforms and all these subforms in single adobe form.

now on the form just have the javascript code to set the visibility as suggested by Sanoosh.

Cheers,

Sai