PDA

View Full Version : Drop down constrains in lookup



Anders Ohrt
26-Jun-2007, 09:24 AM
Hi,

I've added some drop downs (<select>) to a lookup I have, but I wrote this
manually using the old techniques which didn't turn out very well so I was
wondering if this is something I can do using the library instead. As an
example, say using the order entry sample and having an order header lookup,
but wanting to constrain the lookup on a specifik customer using a drop down
in the lookup.

If this works, the next problem is I want to constrain the content of the
drop down with another drop down. Continuing the above example, a drop down
of states, and after selecting state I can select customers in that state
using another drop down. But of course I need order header to be the main,
not customer... (need tons of other constrains from other files)...
Possible?

// Anders

Bob Worsley
26-Jun-2007, 12:26 PM
Hi Anders... without having tried it I'd think it would be possible. The
contact management example has radio buttons down at the bottom for setting
constraints, maybe the concept behind those would do it for you -- there's
some built-in calls and methods available. You might have to use a
different wbo from your main one though and I'm not sure how that would
work.
Bob

"Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
news:jIt2v2$tHHA.3884@dacmail.dataaccess.com...
> Hi,
>
> I've added some drop downs (<select>) to a lookup I have, but I wrote this
> manually using the old techniques which didn't turn out very well so I was
> wondering if this is something I can do using the library instead. As an
> example, say using the order entry sample and having an order header
lookup,
> but wanting to constrain the lookup on a specifik customer using a drop
down
> in the lookup.
>
> If this works, the next problem is I want to constrain the content of the
> drop down with another drop down. Continuing the above example, a drop
down
> of states, and after selecting state I can select customers in that state
> using another drop down. But of course I need order header to be the main,
> not customer... (need tons of other constrains from other files)...
> Possible?
>
> // Anders
>
>
>

Anders Ohrt
26-Jun-2007, 01:43 PM
> Hi Anders... without having tried it I'd think it would be possible. The
> contact management example has radio buttons down at the bottom for
> setting
> constraints, maybe the concept behind those would do it for you -- there's
> some built-in calls and methods available.

I looked at them before, but they are hard coded radios so it's quite
different. I already have some checkboxes and hard coded drop downs so
constraining on a non-dd field is not the problem...


> You might have to use a
> different wbo from your main one though and I'm not sure how that would
> work.

.... but I think this might be the key. If I put the drop downs in their own
form and use a different wbo for them, maybe they won't get mixed up with
the main form and I can then get the drop down behaviour I need and just do
the constraining manually. Might get a bit messy, but could work...

// Anders

Anders Ohrt
27-Jun-2007, 07:52 AM
> Hi Anders... without having tried it I'd think it would be possible. The
> contact management example has radio buttons down at the bottom for
> setting
> constraints, maybe the concept behind those would do it for you -- there's
> some built-in calls and methods available. You might have to use a
> different wbo from your main one though and I'm not sure how that would
> work.

No luck, unfortunatly. I couldn't get a drop down to be populated how ever I
tried, is it possible at all?

// Anders

Edwin van der Velden
27-Jun-2007, 08:10 AM
> Hi,
>
> I've added some drop downs (<select>) to a lookup I have, but I wrote this
> manually using the old techniques which didn't turn out very well so I was
> wondering if this is something I can do using the library instead. As an
> example, say using the order entry sample and having an order header
> lookup, but wanting to constrain the lookup on a specifik customer using a
> drop down in the lookup.

It should be possible to build a dropdown and it should also be possible to
set the rowid of the customer, then you can call a lookup constrained to the
customer.
There is a bit of a problem with constrained lookups, but I posted a fix for
this in the "Lookup constraints" post by Bob which should make the lookup
actually send the customer rowid as well and constrain by it.

>
> If this works, the next problem is I want to constrain the content of the
> drop down with another drop down. Continuing the above example, a drop
> down of states, and after selecting state I can select customers in that
> state using another drop down. But of course I need order header to be the
> main, not customer... (need tons of other constrains from other files)...
> Possible?
>
> // Anders

This sounds more complicated and I would have to look into that to make sure
of any possibilites here, but since I'm short on time currently I'll try
thinking out loud. What you could do is use the remote method invocation to
a call a method which builds the first dropdown, then whenever the dropdown
value changes you call, again using the remote methode invocation, a second
function that builds the second dropdown. This second dropdown will set the
customer rowid whenever it's vvalue changes as mentioned above (also
rebuilding this dropdown should (re)set the customer rowid). As far as I
recall, been a while since I last added a rmi call, you can call and
published function in any WO so you can use a DDO strucure specifically
designed for your functions.

I hope this all makes any sense, if not, I'm sure someone will point that
out ;-)

-Edwin




"Anders Öhrt" <Anders.Ohrt@berendsen.se> wrote in message
news:eFfz2nLuHHA.2024@dacmail.dataaccess.com...
>
>> Hi Anders... without having tried it I'd think it would be possible. The
>> contact management example has radio buttons down at the bottom for
>> setting
>> constraints, maybe the concept behind those would do it for you --
>> there's
>> some built-in calls and methods available. You might have to use a
>> different wbo from your main one though and I'm not sure how that would
>> work.
>
> No luck, unfortunatly. I couldn't get a drop down to be populated how ever
> I tried, is it possible at all?
>
> // Anders
>

Anders Ohrt
28-Jun-2007, 03:41 AM
> This sounds more complicated and I would have to look into that to make
> sure
> of any possibilites here, but since I'm short on time currently I'll try
> thinking out loud. What you could do is use the remote method invocation
> to a call a method which builds the first dropdown, then whenever the
> dropdown value changes you call, again using the remote methode
> invocation, a second function that builds the second dropdown. [...]

Actually, that is what I was thinking of doing, but it seemed like a bit
much manual labor so I though I'd check if there was a way to get the
library to do this for me. =)

// Anders