I have got to the point where I succesfully execute the DO
in the page's OnBeforeDisplay event. Then in the repeated's
OnBeforeRowDisplay after I get a handle on the DO I want to get
the row number that the DO is currently on and bind the display field to the data
field for the current row (getValue of DO row and setDisplayFieldValue of
repeated).
However, I keep getting a compile error when trying to call the getRowIndex()
method
-
Method getRowIndex() not found in class spider.database.CSpSelect
Here is what my code looks like -
int current = 0;
int count = 0;
CSpLong currDrId = new CSpLong(0);
CSpSelect curDo = (CSpSelect) CSpider.getDataObject("doSelectDR");
count = curDo.getNumOfRows();
current = curDo.getRowIndex();
CSpHtml.sendMessage("Total Rows is: " + count + "DATA OBJECT: " + curDo + "<BR>");
CSpRepeated testRptd = (CSpRepeated) event.getSource();
CSpHtml.sendMessage("Repeated GetSource: " + testRptd + "getCurrFirstRow " +
testRptd.getCurrFirstRow() + "<BR>");
currDrId = (CSpLong) curDo.getValue(current, "design_reg_id");
testRptd.setDisplayFieldValue("testDrId", currDrId);
How do I get the row number for the DO?? If possible could you elaborate on the
following -
>get the value out of its results set (whether you get the
>results set via getLastResults() or using the DO's convenience methods),
>using the rowindex as the row argument (available by calling getRowIndex()
>on the event argument that is passed to onBeforeRowDisplay).
Where do I call the getRowIndex and how do I pass it to the repeated's
onBeforeRowDisplay event. Can I call it directly from within the Repeated's
onBeforeRowDisplay??
I will really appreciate any help or suggestions.
Nilima
408-970-2236
________________________________________________________________
Curt Springer <[EMAIL PROTECTED]> wrote:
>(I think this came up less than a week ago)
>
>Easiest thing is to unbind the fields completely.
>
>Then in SomeRepeated_onBeforeRowDisplayEvent, figure out which DO you want
>to use, and get the value out of its results set (whether you get the
>results set via getLastResults() or using the DO's convenience methods),
>using the rowindex as the row argument (available by calling getRowIndex()
>on the event argument that is passed to onBeforeRowDisplay).
>
>Set the value from the DO into the field using either setValue on a
>reference to the field, or setDisplayFieldValue on the repeated (you can
>get a reference to the repeated by calling getSource() on the event
>argument that is passed to onBeforeRowDisplayEvent, and casting it to
>CSpRepeated).
>
>-- Curt Springer, Team NetDynamics
>
>
>At 03:19 PM 5/7/99 -0800, [EMAIL PROTECTED] wrote:
>>Hi Folks,
>>
>>I have a page with Repeateds and Text Boxes whose fields are statically
>bound to a
>> DO. Is there a way to dynamically change or set the binding of these
>display fields
>> to a different data object's data fields at run time.
>>
>>I have looked into the setBoundDataObjects and setBoundDataField methods.
>I have tried
>> to set the BoundDO in the page's OnBeforeDOExec event and set the display
>fields
>> in the objects OnBeforeDisplay events for text fields and
>OnBeforeDOExecute event
>> for repeateds but so far haven't got my code to work.
>>
>>Any suggestions/sample code/help from all you experts in this area will be
>greatly appreciated.
>>
>>Thanks,
>>Nilima Desai
>>Hewlett Packard Co.
>>408-970-2236
>>_________________________________________________________________________
>>
>>For help in using, subscribing, and unsubscribing to the discussion
>>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>>
>>For dire need help, email: [EMAIL PROTECTED]
>>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]