+1
Є відповідь

Show/hide a panel depending on the pager page

jakelisby 12 років тому оновлено icahill (Administrator) 12 років тому 5
I'm trying to say on page1 of the pager, don't show panelX , but on everything else, show it. What would that action look like?
Ok Jake, let's figure this out.

Is the panel you want to show/hide inside of the pager or outside?
It's outside of the pager as a sibling listed after the pager so it displays on the top of everything.
Ok.

Well you could run an if statement that alphas off the panel if the pager's current page # is 1. Pager has an object property for the current page.


<action name="panel-off">
<if lhs="[object:nameofpager.page]" operator="ne" rhs="1">
<alpha value="0" time="0" target="nameofpanel" />
</if>
<if lhs="[object:nameofpager.page]" operator="e" rhs="1">
<alpha value="1" time="0" target="nameofpanel" />
</if>
</action>
Ok, cool. Since page1 is the first thing that shows in my app, should I be calling this action in some way? Is there a way to call in onload?
Any action that you want to load on launch of the app, you can add an attribute called oninit="yes"


<action name="action1" oninit="yes">
<!--insert actions here-->
</action>