def jsSetNavigationIndex(self, index): """ Creates the javascript to switch to a different position within the items: index - the first item you want to appear in your pages results """ return "WebElements.get('%(id)sIndex').value = '%(index)d';%(handlers)s;" % { "id": self.fullId(), "index": index, "handlers": "\n".join([ClientSide.var(result) for result in self.emit("jsIndexChanged")]), }
def on(self, event, action): if type(action) in (types.ListType, types.TupleType): action = ClientSide.Script(";".join([ClientSide.var(actionScript) for actionScript in action])) return ClientSide.addEvent(self, event, ClientSide.eventHandler(action))