Skin-engine quirks (1 Viewer)

CyberSimian

Test Group
  • Team MediaPortal
  • June 10, 2013
    3,750
    2,892
    Southampton
    Home Country
    United Kingdom United Kingdom
    onfocus
    Recently I tried coding this:

    Code:
    <onfocus>#(iif(eq(#skin.search.id,0),skin.setstring('#skin.search.id',10)))</onfocus>

    Unfortunately this does not work. It seems that for <onfocus> the skin engine treats the iif condition as true, even when it is false. The workaround for this is to reverse the order of the iif and the setstring, like so:

    Code:
    <onfocus>#(skin.setstring('#skin.search.id',iif(eq(#skin.search.id,0),10,#skin.search.id)))</onfocus>

    -- from CyberSimian in the UK
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    5,288
    4,287
    Nuenen
    Home Country
    Netherlands Netherlands
    Code:
    <onfocus>#(iif(eq(#skin.search.id,0),skin.setstring('#skin.search.id',10)))</onfocus>
    wow this is a weird construction,that will heavily depend on execution order of those 2 parameters in the iff
    And as you found out, in your case the order is probably the other way around than you expected...
     

    Users who are viewing this thread

    Top Bottom