Web Connection
conditional column expression for bindings
Gravatar is a globally recognized avatar based on your email address. conditional column expression for bindings
  Michael Hogan (Ideate Hosting)
  All
  Sep 18, 2020 @ 01:33pm

In WebConnect 5.53 I have a bound column so that it shows a link for adding the line item:

locol.EXPRESSION="Href([store01.tds?id=]+[TitleRec]+TRANSFORM(cat_id)+TRANSFORM(client_id),'Add to Cart')"

But in a certain condition (ISNULL(CheckMe)), I want it to say "In Cart" with no link.

I thought I could use an IIF() but that seems to be colliding with the WW grid object method that expands the expression into html code. Perhaps I'm using the wrong approach? Should I be placing the html code into the data source instead?

Gravatar is a globally recognized avatar based on your email address. re: conditional column expression for bindings
  Michael Hogan (Ideate Hosting)
  Michael Hogan (Ideate Hosting)
  Sep 18, 2020 @ 01:42pm

Yes - I found that if I place my html code into the cursor column and display that instead, it works the way I expect. That'll do.

Gravatar is a globally recognized avatar based on your email address. re: conditional column expression for bindings
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Sep 18, 2020 @ 01:51pm

If you're defining the column in code can't you just conditionally inject the hyperlink or a simple text expression? Easier to read with a real IF statement vs. trying to inline a conditional expression.

+++ Rick ---

© 1996-2024