Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

wwWebRepeater not saving problem

$
0
0
wwWebRepeater not saving problem
Web Connection 5.0
wwWebRepeater not saving problem
Nov. 18, 2012
07:25 am
3NB0FWKRGShow this entire thread in new window
Gratar Image based on email address
From:Serge Grichmanoff
To:All
I'm a math guy, who is growing more and more frustrated trying to get the web to behave as expected...

In essence I need an editable grid; behaviour more like a traditional spreadsheet. I tried working with grids but that didn't work out so well, so, I thought a repeater might be better. The look is closer to what I was hoping for, except, I can't save anything. Perhaps it's my complete lack of knowledge on VFP or perhaps WC, but, inevitably nothing works.

In the case of the repeater, here is what I have in the WC5 form

<code lang = "html">
<ww:wwWebPanel ID="WwWebPanel1" width="990px" Height="500px" ScrollBars="Auto" runat='server'>
<table class="blackborder">
<ww:wwWebRepeater ID="GeoParms" runat="server" DataSource="SocioGeoDemoGraphic_Parms">
<ItemTemplate>
<tr>
<td style="width: 50px;">
<ww:wwWebCheckBox runat="server" ID="chkSelected" />
<htmlcheckbox("chkSelected_" + transform(ID),"", SocioGeoDemoGraphic_Parms.Selected) >
<!-- <ww:wwWebCheckBox ID="WwWebCheckBox1" runat="server" ControlSource="SocioGeoDemoGraphic_Parms.Selected" /> -->
</td>
<td style="width: 500px;">
<%= SocioGeoDemoGraphic_Parms.Description%>
</td>
<td style="width: 100px;">
<ww:wwWebTextBox ID="WwWebLabel1" runat="server"
ControlSource= "SocioGeoDemoGraphic_Parms.value" >
</ww:wwWebTextBox>
</td>
</tr>
</ItemTemplate>
</ww:wwWebRepeater>
</table>
<ww:wwWebButton runat="server" ID="btnSave" Text="Save" Click="btnSave_Click" />
</ww:wwWebPanel>

As you can see I tried testing tying directly to the controlsource as well,but, in either case it simply fails to save.

In the VFP code, here is basically the guts;

Function OnLoad()

This.Page.EnableSessionState = .T.
This.oUser = Createobject("Client_Dataclass")
This.lUserName=Session.GetSessionVar("SGA_username")
This.lblTxtLoggedInAs.Text="Logged in as: " + This.lUserName
This.lbl_junk.preserveproperty("text")

If This.IsPostBack
Else
Select Recno() As Id, Attribute, operator, Descriptio As Description, 000.00 As Value, .F. As Selected ;
FROM Addbs(Config.cDataPath)+"ClientAccess\geodemoparms" Into Cursor SocioGeoDemoGraphic_Parms ReadWrite
Endif

Endfunc
* Onload

Function OnPreRender()
This.RenderGrid()
Endfunc

Function RenderGrid()
This.GEOPARMS.Datasource=[SocioGeoDemoGraphic_Parms]
This.GEOPARMS.DataSourceType = 1
This.databind()
Endfunc

Function btnSave_Click()
Local lnCount, lnX

*** Grab all the checkbox form variables
Dimension laVars[1,2]
lnCount = Request.aFormVars(@laVars,"chkSelected_")

WAIT WINDOW lncount

Select SocioGeoDemoGraphic_Parms

*** Because we're dealing with checkboxes which don't post values back if not set
*** we have to update all values to unselected first.
*** If you're running against a full table you'd have to filter this update to match
*** your subset
*Update SocioGeoDemoGraphic_Parms Set Selected = .F. && where customerId = lnCustId

For lnX = 1 To lnCount
*** Grab the id from the Field ID
lnId = Val(Strtran(laVars[lnX,1],"chkSelected_"))
Update SocioGeoDemoGraphic_Parms Where Id = lnId Set Selected = .T.
Endfor

Endfunc

I trapped the result of lncount; the value is 0. Obviously I screwed up since I am apperantly gathering nothing... I have also checked to edit the cursor and you can...

What the heck am I doing wrong????

Serge



Viewing all articles
Browse latest Browse all 10393

Trending Articles