PDA

View Full Version : Constrain with Ajax?



JoacimEriksson
20-Oct-2007, 03:27 AM
Is it possible?

I have just started with Ajax and asp and so on. So bare with me.

This is my case:

I have a Ajax project, everything looks very neat, by the way.

I want to see my order status with some restrictions if Iwant to.

I have 3 input fields with lookups, Client, customer, way of transport.
these fields can be filled in or leaved blanked.

I want a button and when this is clicked I want my constrain to be set up
and the order information that
fills the constrain to be shown in a AjaxList so that I can do page down and
if possible search and so on.

The input fields no problem
The button to show list, no problem
The AjaxList no problem

But the problem I have is to set up this constrain.

Any hints?

regards

Joacim Eriksson

Bob Worsley
20-Oct-2007, 08:32 AM
Hi Joacim - Here's how you do it. Any variable that you want to constrain
with should be in a hidden field if not already in a regular data field. If
for example you need to constrain by a data field that's not on the screen,
add a hidden field for it, being sure to use the double underscore syntax.
For anything not a data element, use a single underscore.

If the data you need to constrain by is in a session variable, set up your
hidden field as follows

<input type="hidden" size="15" name="user_companyid" value=<%=iCompanyId%>
/>

In the back end, do this:

Procedure OnAjaxRequestSetStart TAjaxRequestSet ByRef requestSet
Integer iCompanyId
Forward Send OnAjaxRequestSetStart (&requestSet)
Get GeTAjaxRequestUserData "user_companyid" to iCompanyId
Set piCompanyID to iCompanyID
Send Rebuild_Constraints to oCustomer_DD
End_Procedure

Property piCompanyID is defined in the DD or the WO, whereever you think
best. In this case I'm constraining the customer DD to the company ID I
passed in from the ASP page.

In OnAjaxRequestSetEnd clear the property and constraints.

Bob

"Joacim Eriksson" <joacim@brl.nu> wrote in message
news:Wk%23EUMvEIHA.2312@dacmail.dataaccess.com...
> Is it possible?
>
> I have just started with Ajax and asp and so on. So bare with me.
>
> This is my case:
>
> I have a Ajax project, everything looks very neat, by the way.
>
> I want to see my order status with some restrictions if Iwant to.
>
> I have 3 input fields with lookups, Client, customer, way of transport.
> these fields can be filled in or leaved blanked.
>
> I want a button and when this is clicked I want my constrain to be set up
> and the order information that
> fills the constrain to be shown in a AjaxList so that I can do page down
and
> if possible search and so on.
>
> The input fields no problem
> The button to show list, no problem
> The AjaxList no problem
>
> But the problem I have is to set up this constrain.
>
> Any hints?
>
> regards
>
> Joacim Eriksson
>
>
>

JoacimEriksson
22-Oct-2007, 01:33 PM
Thanks Bob, that did the trick...
I got a Get_Data_Field error when I show the list,
but now I have something to do tomorrow at work :)

many thanks

// joacim Eriksson

"Bob Worsley" <bworsley@comcast.net> skrev i meddelandet
news:HpTAo2xEIHA.2312@dacmail.dataaccess.com...
> Hi Joacim - Here's how you do it. Any variable that you want to constrain
> with should be in a hidden field if not already in a regular data field.
> If
> for example you need to constrain by a data field that's not on the
> screen,
> add a hidden field for it, being sure to use the double underscore syntax.
> For anything not a data element, use a single underscore.
>
> If the data you need to constrain by is in a session variable, set up your
> hidden field as follows
>
> <input type="hidden" size="15" name="user_companyid" value=<%=iCompanyId%>
> />
>
> In the back end, do this:
>
> Procedure OnAjaxRequestSetStart TAjaxRequestSet ByRef requestSet
> Integer iCompanyId
> Forward Send OnAjaxRequestSetStart (&requestSet)
> Get GeTAjaxRequestUserData "user_companyid" to iCompanyId
> Set piCompanyID to iCompanyID
> Send Rebuild_Constraints to oCustomer_DD
> End_Procedure
>
> Property piCompanyID is defined in the DD or the WO, whereever you think
> best. In this case I'm constraining the customer DD to the company ID I
> passed in from the ASP page.
>
> In OnAjaxRequestSetEnd clear the property and constraints.
>
> Bob
>
> "Joacim Eriksson" <joacim@brl.nu> wrote in message
> news:Wk%23EUMvEIHA.2312@dacmail.dataaccess.com...
>> Is it possible?
>>
>> I have just started with Ajax and asp and so on. So bare with me.
>>
>> This is my case:
>>
>> I have a Ajax project, everything looks very neat, by the way.
>>
>> I want to see my order status with some restrictions if Iwant to.
>>
>> I have 3 input fields with lookups, Client, customer, way of transport.
>> these fields can be filled in or leaved blanked.
>>
>> I want a button and when this is clicked I want my constrain to be set up
>> and the order information that
>> fills the constrain to be shown in a AjaxList so that I can do page down
> and
>> if possible search and so on.
>>
>> The input fields no problem
>> The button to show list, no problem
>> The AjaxList no problem
>>
>> But the problem I have is to set up this constrain.
>>
>> Any hints?
>>
>> regards
>>
>> Joacim Eriksson
>>
>>
>>
>
>
>