cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLtemplate for custom fields - dynamic behaviour after input (Jscript)

matteo_montalto
Contributor
0 Kudos

Hi all gurus,

I'm working on an SRM3 and must modify a pre-existing html template (SAPLBBP_PDH_CUF 100) to manage the behaviour of two fields:

- ZZ0LEGGE, which is a checkbox (CHAR1, or flag);

- ZZ0DESCR, which is a text field which describes the above flag (fixed values, and a search help is defined on it).

I'd like to manage a behaviour as follows:

- if ZZ0LEGGE is flagged (='X'), then ZZ0DESCR should be available for input;

- if ZZ0LEGGE is blank, then ZZ0DESCR should be only visible but not editable. Moreover, if ZZ0LEGGE is blank, ZZ0DESCR should be cleaned (= blank).

The template is a bit complicated and I'm absolutely a newbie on Javascript. Please forgive me, I 'm not able to post HTML/JavaScript on the forum. I pasted relevant (imho) snippets of code here: [http://pastebin.com/8Xh94Ddq]

I omitted a lot of the template... but maybe this is sufficient to get an idea.

Edited by: Matteo Montalto on Aug 10, 2010 3:31 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

matteo_montalto
Contributor
0 Kudos

Solved!

At least, the first point and... partially 😛

The problem was the definition of the checkbox field. Fixed it, now the "first" task works fine.

Something anyway goes wrong when the same Template is included in another template (different from the test case), I'll open eventually a new thread if my tests will bring no results.

What's the best forum section to discuss about template inclusion and Javascript behaviour? I guess the fact that these are SRM's templates is quite marginal.

Thanks again

matteo_montalto
Contributor
0 Kudos

(EDIT: sorry for the reply, but the whole message in a single post scrambled up the text, so I had to split it )

Now... it doesn't work, in the sense that checking or unchecking ZZ0LEGGE doesn't automatically turn into editable/not editable the second field, ZZ0DESC.

BUT... it works if after every check/uncheck operation I press the REFRESH button.

So, it doesn't trigger automatically. How could I fix it?

And also... how to clean ZZ0DESC every time ZZ0LEGGE is unchecked?

Thanks in advance for your help, any hint is really appreciated

matteo_montalto
Contributor
0 Kudos

Hello,

I posted the entire SAPLBBP_PDH_CUF 100 HTML template [here|http://pastebin.com/AYJNN6BY].

Since the task concerns Javascript more than general SRM arguments, even though refers to an SRM web page, I'd kindly ask moderators eventually to move this thread to a more convenient forum section if SRM General isn't the proper one.

Also... I've seen that the REFRESH button, in the Template 2100 (Contract screen: Buttons on the top) triggers the following function call::

javascript:SetOkCode('=CTR_RFRS', 'BBPForm', '', '','')

Tried then to create a function zFoo() which does, in sequence, the following calls:

function zfoo{
TargetSetOkCode('=ZCTR_CUST1','','BBPForm');
SetOkCode('=CTR_RFRS', 'BBPForm', '', '','');
}

but this sorted no effects. Any idea? Thanks again