• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Conditional around opening part of another component only?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional around opening part of another component only?


  • Subject: Re: Conditional around opening part of another component only?
  • From: John Pollard <email@hidden>
  • Date: Tue, 19 Mar 2013 12:52:21 +0000

Ok, you are right, push towards code when the html gets convoluted, thanks.

On 19 Mar 2013, at 11:59, Johann Werner <email@hidden> wrote:

> Hi John,
>
> a good phrase someone wrote on this list long ago was: if something is complicated to do in WO you are doing it wrong
>
> So to your problem: your hyperlinks are differing in one or more attributes so why not moving those attributes to your code and returning the appropriate value there instead of making complicated HTML spaghetti ;-)
>
> <ERXHyperlink href="$myConditionalHref">
> ... bunch of html that applies to both the above conditions
> </wo:ERXHyperlink>
>
>
> in code:
>
> public String myConditionalHref() {
> 	return condition ? value1 : value2;
> }
>
>
> Am 19.03.2013 um 12:35 schrieb John Pollard <email@hidden>:
>
>> Is there any way to conditionally determine the opening html for a component only, not the whole thing?:
>>
>> <wo:if condition="...">
>>  <wo:ERXHyperlink ...abc>
>> </wo:if>
>> <wo:else>
>> <wo:ERXHyperlink ...xyz>
>> </wo:else>
>> ... bunch of html that applies to both the above conditions
>> </wo:ERXHyperlink>
>>
>> Trying it, I can't, I am told that the  <wo:ERXHyperlink ...abc> at the top is missing its closing tag, so presumably it has to be complete within the if clause.
>>
>> My only solution seems to be to take the "  ... bunch of html that applies to both the above conditions" and put it into a different component, but that is a pain because that html invokes many methods from this component.
>>
>> It feels like it would be nice to turn chunks of html into local html-only-components, that are part of the same WOComponent, but can be referenced more than once.
>>
>> Thanks
>> John
>
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Conditional around opening part of another component only? (From: John Pollard <email@hidden>)
 >Re: Conditional around opening part of another component only? (From: Johann Werner <email@hidden>)

  • Prev by Date: Re: Conditional around opening part of another component only?
  • Next by Date: Immortal… ehm, frozen instances.
  • Previous by thread: Re: Conditional around opening part of another component only?
  • Next by thread: Immortal… ehm, frozen instances.
  • Index(es):
    • Date
    • Thread