Skip to main content

Uniface 9: How to create list on a dsp?

  • November 19, 2018
  • 3 replies
  • 0 views

Jan Cees Boogaard

How to create list on a dsp?

Author: martinandheather@gmail.com (byjones)

If I had a table with a number of string values in, how would I output this on a DSP as an unordered list (with UL and LI tags)?

e.g.
table SOMEVALUES
FIELD   TYPE
======================
ID      int 5     Pkey
VALUE   String

with the values
1     Item1
2     Item2
3     Item3
4     Item4

I would like to have, in the generated source
< ul class="myclass">
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< /ul>

I would then style this with my own CSS

Thanks in advance

Martin

3 replies

Jan Cees Boogaard

How to create list on a dsp?

Author: martinandheather@gmail.com (byjones)

If I had a table with a number of string values in, how would I output this on a DSP as an unordered list (with UL and LI tags)?

e.g.
table SOMEVALUES
FIELD   TYPE
======================
ID      int 5     Pkey
VALUE   String

with the values
1     Item1
2     Item2
3     Item3
4     Item4

I would like to have, in the generated source
< ul class="myclass">
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< /ul>

I would then style this with my own CSS

Thanks in advance

Martin

Hi Martin,

Try using something like this in the layout source:

<ul id="uent:SOMEVALUES.DUMMY">
  <li id="uocc:SOMEVALUES.DUMMY">
    <span id="ufld:VALUE.SOMEVALUES.DUMMY">Static Text</span>
  </li>
</ul>
 

That should produce an output like:

<ul id="uent:SOMEVALUES.DUMMY:TST1">
  <li id="uocc:SOMEVALUES.DUMMY:TST1.1">
    <span style="" id="ufld:VALUE.SOMEVALUES.DUMMY:TST1.1">Item1</span>
  </li>
  <li style="" id="uocc:SOMEVALUES.DUMMY:JRR_TST.2">
    <span style="" id="ufld:VALUE.SOMEVALUES.DUMMY:TST1.2">Item2</span>
  </li>
  <li style="" id="uocc:SOMEVALUES.DUMMY:JRR_TST.3">
    <span style="" id="ufld:VALUE.SOMEVALUES.DUMMY:TST1.3">Item3</span>
  </li>
  <li style="" id="uocc:SOMEVALUES.DUMMY:JRR_TST.4">
    <span style="" id="ufld:VALUE.SOMEVALUES.DUMMY:TST1.4">Item4</span>
  </li>
</ul>

Hope that helps.

James


Author: James Rodger (james.r.rodger@gmail.com)

Jan Cees Boogaard

How to create list on a dsp?

Author: martinandheather@gmail.com (byjones)

If I had a table with a number of string values in, how would I output this on a DSP as an unordered list (with UL and LI tags)?

e.g.
table SOMEVALUES
FIELD   TYPE
======================
ID      int 5     Pkey
VALUE   String

with the values
1     Item1
2     Item2
3     Item3
4     Item4

I would like to have, in the generated source
< ul class="myclass">
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< /ul>

I would then style this with my own CSS

Thanks in advance

Martin

Hi James,

Thanks for the reply. I will give this a go.

I had tried with painting a dummy field, and then giving it the RawHTML attribute, and then doing DUMMYFIELD.DUMMY = "< ul>< li>Item1< /li>< li>Item2< /li>< /ul>" which seemed to work, but your method will be better.
Martin


Author: byjones (martinandheather@gmail.com)

Jan Cees Boogaard

How to create list on a dsp?

Author: martinandheather@gmail.com (byjones)

If I had a table with a number of string values in, how would I output this on a DSP as an unordered list (with UL and LI tags)?

e.g.
table SOMEVALUES
FIELD   TYPE
======================
ID      int 5     Pkey
VALUE   String

with the values
1     Item1
2     Item2
3     Item3
4     Item4

I would like to have, in the generated source
< ul class="myclass">
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< li>Item1< /li>
< /ul>

I would then style this with my own CSS

Thanks in advance

Martin

... or use a dummy entity and getlistitems to populate the records.

Success, Uli


Author: ulrich-merkel (ulrichmerkel@web.de)