Question
Rochdi Badis · Nov 2

textarea in tablepane cell

Hi Guys,

I've bind a textarea to show up in a tablepane cell and it's working fine as follow:

this the column injh question:

    <column colName="FollowUp" header="FollowUp Comments" width="9%" style="text-align:left;" OnDrawCell="txtFollowUp"/>

txtFollowUp method:


Method txtFollowUp(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) As %Status
{
    &html<<textarea name="followup" name="followup" rows="3" text="#(%query(pName))#" style=" width: 95%;" onchange="zenPage.saveFollowUp(this,#(%query("id"))#);">#(%query(pName))#</textarea>>
    Quit $$$OK
}

 

and 

the client method executed textarea onchange:

ClientClassMethod saveFollowUp() [ Language = javascript ]
{
    var table = zenPage.getComponentById('MissingItemsTable');
    if ((table.selectedIndex >= 0) && (table.getRowData(table.selectedIndex) != null)) {
        var follow=table.getRowData(table.selectedIndex).FollowUp;

}

On change I would like to be able to pickup the text entered in the textarea while typing it of finished from typing but client method is not picking up the typed text, so any help?

Hi Guys,

I've bind a textarea to show up in a tablepane cell and it's working fine as follow:

this the column injh question:

    <column colName="FollowUp" header="FollowUp Comments" width="9%" style="text-align:left;" OnDrawCell="txtFollowUp"/>

txtFollowUp method:


Method txtFollowUp(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) As %Status
{
    &html<<textarea name="followup" name="followup" rows="3" text="#(%query(pName))#" style=" width: 95%;" onchange="zenPage.saveFollowUp(this,#(%query("id"))#);">#(%query(pName))#</textarea>>
    Quit $$$OK
}

 

and 

the client method executed textarea onchange:

ClientClassMethod saveFollowUp() [ Language = javascript ]
{
    var table = zenPage.getComponentById('MissingItemsTable');
    if ((table.selectedIndex >= 0) && (table.getRowData(table.selectedIndex) != null)) {
        var follow=table.getRowData(table.selectedIndex).FollowUp;

}

On change I would like to be able to pickup the text entered in the textarea while typing it of finished from typing but client method is not picking up the typed text, so any help?

Thanks

 

Product version: Ensemble 2014.1
00
1 0 4 61
Log in or sign up to continue

It looks like where you defined your method, it takes zero arguments. When you're calling it, you're providing two. That would make the event not work properly.

Try this:

Class dc.test Extends %ZEN.Component.page
{

XData Contents [ XMLNamespace "http://www.intersystems.com/zen" ]
{
<page xmlns="http://www.intersystems.com/zen">
  <tablePane id="tp" sql="select 1 id, 'a' FollowUp union select 2,'b'">
    <column colName="id"/>
    <column colName="FollowUp" header="FollowUp Comments" width="9%" style="text-align:left;" OnDrawCell="txtFollowUp"/>
  </tablePane>
</page>
}

Method txtFollowUp(
  pTable As %ZEN.Component.tablePane,
  pName As %String,
  pSeed As %StringAs %Status
{
    &html<<textarea name="followup" rows="3" style=" width: 95%;" onchange="zenPage.saveFollowUp(this.value,#(%query("id"))#);">#(%query(pName))#</textarea>>
    Quit $$$OK
}

ClientMethod saveFollowUp(
  val,
  id) [ Language = javascript ]
{
  zenAlert(val,' <-> ',id);
}

}

That worked, thanks you very much Vitaliy.