cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically put a text in line heading in a table control

Former Member
0 Kudos

Dear friend,

How we can dynamically put a text in line heading in a table control?

this is very urgent, pl'z help.

Vikrant Shukla

Accepted Solutions (0)

Answers (1)

Answers (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

You mean in the tableView ?

<htmlb:tableView id              = "tvx"
                 headerText      = "<%= sy-uzeit %>"
                 headerVisible   = "true"
...
/>

Best regards,

Guillaume

Former Member
0 Kudos

no dear,

i want to create a table control and want to change the label text on run time which is written on the i /o field, on run time the value is passed vy another i/o field.

raja_thangamani
Active Contributor
0 Kudos

Using this approach u can change the value for any fields, for example to change the header...

  headerText      = "<%= your_variable %>"

Populate the value of <i>your_variable</i> at runtime...

If i misunderstood, pls explain the requirement in detail..

Raja T

guillaume-hrc
Active Contributor
0 Kudos

Hi,

When you say <i>on run time</i>, do you mean <u>without any server round-trip</u>?

If this is the case (personnally, I call this <i>on the client-side</i>), I would suggest thinks like :

<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>

<htmlb:content design="design2003">
  <htmlb:document>

    <htmlb:documentHead title="Javascript ot the rescue!">
      <htmlb:headInclude/>
        <script type="text/javascript">
        function changeTitle (idTable, newTitle) {
          var trgtTable = document.getElementById(idTable);
          var thTag     = trgtTable.firstChild.firstChild.firstChild;

          thTag.innerHTML = newTitle;
        }
        </script>
     </htmlb:documentHead>

    <htmlb:documentBody>
    <htmlb:form>

     <% DATA: wt_sflights TYPE TABLE OF sflights.

        SELECT * FROM sflights UP TO 20 ROWS INTO TABLE wt_sflights. %>

     <htmlb:button text="Change title"
                   onClientClick="changeTitle('tvx','My own will');" />

     <htmlb:tableView id                   = "tvx"
                      headerText           = "Flights"
                      headerVisible        = "true"
                      table                = "<%= wt_sflights %>" />

    </htmlb:form>
    </htmlb:documentBody>
  </htmlb:document>
</htmlb:content>

Now, you just have to set the Javascript function changeTitle to the event of your choice !

Best regards,

Guillaume

Former Member
0 Kudos

Dear sir,

i m working in ABAP work bench not in BSP.

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Then, try this forum instead:

Best regards,

Guillaume