Again, JSON is a data format. There is no way to represent logic in JSON. You can, however, use JavaScript or any other JVM language for this. There are a number of examples in the tutorial that demonstrate scripting in Pivot - the following example shows how you can use Java, Scala, JavaScript, and Groovy to implement a simple application:
http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/scripting/ You can also use property binding to automatically set property values as other properties or variables change - see this tutorial for more info: http://pivot.apache.org/tutorials/property-binding.html G On Jan 25, 2011, at 3:57 PM, Aanjaneya Shukla wrote: > No, I guess the point he is trying to make here is, suppose you want to pull > in information from the json and populate textbox text property. This can be > done by pivot framework by writing as '%textname'. So similarly is there any > way by which based upon some conditions i want to enable/disable the > pushbutton/radiobutton, how do i code that in JSON. > > > ________________________________________ > From: Greg Brown [[email protected]] > Sent: Tuesday, January 25, 2011 18:22 > To: [email protected] > Subject: Re: Integrating JSON with BXML > > JSON is a data format. Do you mean JavaScript? > > On Jan 25, 2011, at 1:57 AM, dranzer_duch wrote: > >> >> hi, >> I would like to know, how to handle events in JSON, corresponding to >> controls defined in the BXML file. >> Like say for example, i have a button, and based upon some conditions i want >> to enable/disable the pushbutton/radiobutton, how do i code that in JSON? >> >> I want to use JSON for this part specifically as for me the action part >> being in JSON is more profitable, when it comes to customizing based on user >> input. >> >> And also I would like to know, if i wish to customize my pivot-bxml-json >> screens based on user input, (like say for example, if user clicks button A, >> 3 more actions should follow, if user clicks button B, 2 other actions >> should follow), where to place all the action code? ( i think, if possible >> in JSON, JSON is a good option, though i would like some suggestions) >> -- >> View this message in context: >> http://apache-pivot-users.399431.n3.nabble.com/Integrating-JSON-with-BXML-tp2327065p2327065.html >> Sent from the Apache Pivot - Users mailing list archive at Nabble.com. >
