Focal Point
Problems with HTML code

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4001009331

September 21, 2005, 06:41 AM
<user198>
Problems with HTML code
Hello,

i also have a problem with my html-code because the &TNEU is not completed, as you can see below.
Perhaps you know why?
Is the statement to long?

Thanks,
Katy

My fex:

TABLE FILE wg_kd_betreuung
-SET &C=1;
-SET &TNEU=' ';
-IF &Team0.EXISTS THEN GOTO LOOP2 ELSE GOTO DONEALL;
-LOOP2
-SET &TNEU= '<input name="Team" value="&Team" type="hidden">';
-IF &Team0.EXISTS NE 1 THEN GOTO NOARRAY;
-REPEAT NOARRAY FOR &C FROM 2 TO &Team0;
-SET &TNEU = &TNEU | ' <input name="Team" value="&Team.&C" type="hidden">';
-NOARRAY
-GOTO ALLESDONE
-DONEALL
-IF &Team.EXISTS EQ 1 THEN GOTO STEP2 ELSE GOTO ALLREADY;
-STEP2
-SET &TNEU= '<input name="Team" value="&Team" type="hidden">';
-ALLREADY
-ALLESDONE
END
...
<input name="KZ" value="AT" type="hidden">
<input name="k" value="AU" type="hidden">
&TNEU.EVAL
<input name="FMT" value="PDF" type="hidden">
<input name="Submit" value="PDF-Format" type="submit" class="button"></td>
...

My html page produces the follwing:

<input name="KZ" value="AT" type="hidden">

<input name="k" value="AU" type="hidden">

<input name="Team" value="LAX WG3/U" type="hidden"> <input name="Team" value="MNL WG32/M" type="

<input name="FMT" value="PDF" type="hidden">

<input name="Submit" value="PDF-Format" type="submit" class="button"></td>
September 21, 2005, 07:30 AM
susannah
yeah this happens a lot.
makes me crazy. i switched to servlet from isapi for some of my complicated html-written output, and that worked in some cases, but what you need to do is simpler, just break up your code lines
-SET &TNEU2 = ' <input name="Team" value="&Team.&C" type="hidden">';
..then write it out
&TNEU.EVAL
&TNEU2.EVAL

and you have to be cheeky how you break up your code; sometimes a linebreak gets stuck in there and its hard to get out, so you break up your code NOT at the tag level, but within the tag.
eg; not '<...>'
but rather
'<input name="kz" '
and then the next var is the end of the tag
' value="AT" type="hidden">'
Just hammer away and you'll get it to work.
September 21, 2005, 08:49 AM
Tony A
Katy,

The point in your code that concerns me is that you will have more than one hidden INPUT named "Team".
September 21, 2005, 09:05 AM
<user198>
Yes, this is what I want. Via a button I launch another fex. In my form action... I have to pass multiple teams. This is why I have a loop and there I want to produce something like this:

<input name="Team" value="Team1" type="hidden">
<input name="Team" value="Team2" type="hidden">
<input name="Team" value="Team3" type="hidden">
<input name="Team" value="Team4" type="hidden">

But at the moment I have a break in the HTML-code like:
<input name="Team" value="LAX WG3/U" type="hidden"> <input name="Team" value="MNL WG32/M" type="

I have tried the solution of Susannah but it makes no sence with my loop.

Do you now understand what I mean?
September 21, 2005, 12:04 PM
Tony A
Katy,


Why not move the loop into the HTML and deal with the generation of the HTML directly?

Using -



-SET &C=1;

-IF &Team0.EXISTS THEN GOTO LOOP2 ELSE GOTO DONEALL;
-LOOP2
-IF &Team0.EXISTS NE 1 THEN GOTO NOARRAY;
-REPEAT NOARRAY FOR &C FROM 2 TO &Team0;

-NOARRAY
-GOTO ALLESDONE
-DONEALL
-IF &Team.EXISTS EQ 1 THEN GOTO STEP2 ELSE GOTO ALLREADY;
-STEP2
-ALLREADY
-ALLESDONE

will give you what you want.

This message has been edited. Last edited by: <Maryellen>,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 21, 2005, 03:02 PM
susannah
yes, thats a great idea. tony's suggestion works really well.
embedding dialog manager into html output is something you don't read about in any manual i don't think, its just something you try one day and say 'cool' when it works!
September 21, 2005, 05:15 PM
David Briars
Greetings,

A while back, I was curious if I could embed Dialogue Manager commands within the -HTMLFORM commands.

In my research I found this case on the IB Website:

quote:

Case: 81051065 Product: WebFOCUS Release: 4.3 4.3.6 Primary OS: UNIX Date: 03/04/16
Case information refers to the Product, Release, and OS for which this question was asked.
The solution may apply to other Products, Releases, and Operating Systems.

Problem:

Can Dialogue Manager commands be used in HTMLFORM section of a Focexec?


Solution:

It is -NOT- possible to use Dialogue Manager commands in the HTMLFORM section
of a Focexec. This is do to the fact that the code between the HTMLFORM tags
does not parse FOCUS code, but only looks for !IBI.FIL.xxx; and !IBI.AMP.xxx;


Product: WebFOCUS, WEBFOCUS
I decided to check with the website, since the manual (WebFOCUS Developing Reporting Applications) did not seem to be too clear on this topic one way or another.

I opened my own case with the IB Helpdesk, and they agreed with case I found, and suggest that I did not code DM commands within -HTMLFORM.

Regards,
Dave
September 21, 2005, 07:54 PM
Francis Mariani
In fact, the code has been tightened between 5.2 and 5.3 and this is how you're supposed to code DM in HTMLFORM:

-HTMLFORM BEGIN
...
<input name="KZ" value="AT" type="hidden">
<input name="k" value="AU" type="hidden">
-HTMLFORM END
-SET &C=1;
-HTMLFORM BEGIN
<input name="Team" value="!IBI.AMP.Team;" type="hidden">
-HTMLFORM END
-IF &Team0.EXISTS THEN GOTO LOOP2 ELSE GOTO DONEALL;
-LOOP2
-IF &Team0.EXISTS NE 1 THEN GOTO NOARRAY;
-REPEAT NOARRAY FOR &C FROM 2 TO &Team0;
-SET &TeamX = &Team.&C;
-HTMLFORM BEGIN
<input name="Team" value="!IBI.AMP.TeamX;" type="hidden">
-HTMLFORM END
-NOARRAY
-GOTO ALLESDONE
-DONEALL
-IF &Team.EXISTS EQ 1 THEN GOTO STEP2 ELSE GOTO ALLREADY;
-STEP2
-ALLREADY
-ALLESDONE
-HTMLFORM BEGIN
<input name="FMT" value="PDF" type="hidden">
<input name="Submit" value="PDF-Format" type="submit" class="button"></td>
...
-HTMLFORM END
September 22, 2005, 01:19 AM
j.gross
Is multiple htmlform begin/end sequences (allowing interspersed DM) documented as a supported feature?

In a much earlier WF release I built an app using precisely that structure -- only to have it break one release later: only the first -HTMLFORM chunk would make it to the html output.
September 22, 2005, 03:49 AM
Tred
Katy, I have had this occur on many occasions, and I find that I need an escape character (the concatenation bar) after the & or else it treats it like an amper variable without any value. - just try this -
-SET &TNEU= '<input name="Team" value="&|Team" type="hidden">';
September 22, 2005, 06:26 AM
<user198>
Tony,

your idea works really great!
Thanks a lot!

Katy
September 22, 2005, 07:55 AM
Tony A
Hi Katy,


I'm pleased that you have managed to get your proc to work. Well done.

The only thing I would advise is that, as Jack and David have mentioned, you need to be aware that this type of code may function now but may not in future releases - if it is unsupported code.

That said, I've not had problems with this type of coding in the releases I've used recently (5.2.3, 5.3.2 and 7.1 - all on windows).

One other possibility that has not been mentioned (apart from Francis), is the use of the IBI HTML variable direct in your code -

...


!IBI.AMP.TNEU;


...
For me, the use of IBI.AMP.TNEU; gives the full HTML but the &TNEU.EVAL drops the last char ">" off of the string even though the HTML functions OK.

Tony

This message has been edited. Last edited by: <Maryellen>,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 22, 2005, 11:03 AM
<user198>
Thank you all for your advises!
I will consider this point.

Katy