|
Post by kokenge on Jul 6, 2009 10:05:14 GMT -5
If you click the Exit App link, this works. If you click the [Exit] button it goes to the RB Login screen. The [Exit] button does the same thing as clicking the Exit App link, it just does it using JS. Also you can hide the Exit App link, but you cannot hide it if you change the link to a button. CSSClass "a.hide", "{visibility: hidden;}"
link #c, "Exit App", [clicked] #c setkey(rowid$) #c setid("clickMe") '#c cssclass("hide") html "<BR>hello World<BR>" button #a,"Exit",[exit] wait
[exit] html "<script> document.getElementById('clickMe').onclick();</script>" wait
[clicked] print print "I've been clicked" wait
|
|
|
Post by kokenge on Jul 7, 2009 12:28:29 GMT -5
Thanks davos..
However it still don't seem to work. When you manually click [Exit App] it goes to the [clicked] tag and prints "I've been clicked"
When you click the [Exit] button it should execute the JS code that clicks the [Exit App] button. It should be doing exactly the same thing as when you manually click [Exit App]. It looks like it does nothing since it does not print "I've been clicked"
Thanks for the help..
|
|
|
Post by davos1 on Jul 7, 2009 16:15:57 GMT -5
ah, ok, thats the big question...: passing parameters from JS to RB... well the onclick should be pointed to [clicked] as it points to the action... but as I know the [clicked] has not an id... to be identified by JS. maybe Carl knows if it could be accesses via the ajax.. we could make interactive RB, and passing event-time based actions. it would be great if a timed based action could be passed from JS to RB and controlled then via RB...
|
|
|
Post by kokenge on Jul 7, 2009 16:36:11 GMT -5
Actually it's possible to fire events now, even timer events. Only problem, the main project page needs fire the timed event, or any event, as another project. It can then update stuff on the main project page. I do that now to check instruments in a background project, and display the instrument graphs on the main page and it works great.. There's a little info about it here: runbasic.proboards.com/index.cgi?action=display&board=general&thread=1099&page=1But you are correct - the new Ajax stuff needs to do this.. Thanks for the help..
|
|
|
Post by StefanPendl on Jul 8, 2009 3:47:25 GMT -5
You may use the following. You must change the actions before they are used, not afterwards. Link and button processing is done in the background. Checking the page source will help you, if you like to change the action of a button or link. CSSClass ".hide", "{visibility: hidden;}"
link #c, "Exit App", [clicked] #c setkey(rowid$) #c setid("clickMe") #c cssclass("hide")
html "<BR/>hello World<BR/>"
link #a,"Exit",[exit] #a setid("ExitMe") print html "<script> document.getElementById('ExitMe').href = document.getElementById('clickMe').href; document.getElementById('ExitMe').onclick = document.getElementById('clickMe').onclick; </script>" wait
[exit] wait
[clicked] print print "I've been clicked" wait
|
|
|
Post by StefanPendl on Jul 8, 2009 4:16:24 GMT -5
This is a working example using buttons, since buttons are of type submit, they are handled differently. BTW, use at your own risk CSSClass ".hide", "{visibility: hidden;}"
button #c, "Exit App", [clicked] #c setkey(rowid$) #c setid("clickMe") #c cssclass("hide")
html "<BR/>hello World<BR/>"
button #a,"Exit",[exit] #a setid("ExitMe") print html "<script> document.getElementById('ExitMe').name = document.getElementById('clickMe').name; </script>" wait
[exit] wait
[clicked] print print "I've been clicked" wait
|
|
|
Post by kokenge on Jul 8, 2009 6:17:58 GMT -5
Thanks Stefan.
Took me a while to understand your code. But works great. I do need to spend time understanding JS better..
Anyway it solved the problem of running a Parent / Child asychronously.
The Child can click a button in the Parent. Just exactly what I was trying to do.
After the Parent runs the Child it creates the hidden [Continue] button and waits. The child when complete, clicks their [Exit] button. The Child [Exit] button actually clicks the Parent [Continue] button.
I still have a couple problems to solve, since I want the Child [Exit] to do some work before it clicks the Parent [Continue]. But that should be easy.
I'm on my way... Thanks for the help... Dan
|
|
|
Post by StefanPendl on Jul 9, 2009 4:25:57 GMT -5
Took me a while to understand your code. But works great. I do need to spend time understanding JS better.. This is not JS, it is pure HTML DOM (you only used the script tags, without specifying javascript as the type attribute), which can be accessed using JS. I am a novice too in this area, but it helps immensely, if you check the source of the created page, which is a feature of any browser. You only have to compare the differences and try some things. A good HTML reference is the second piece to success, I use W3Schools Online Web Tutorials.
|
|
|
Post by kokenge on Jul 9, 2009 8:18:09 GMT -5
Yep! I got a lot to learn. Actually it ain't all that hard, it's just knowing what is available and where to find it when you want it. Thanks for the URL.
And the browsers are getting more power and features. The new HTML-5 stuff looks great. I like the new <Canvas and <Video tags.
When I was a kid, I was always taught not to push your parents buttons. But sometimes you win..
Thanks again..
Dan
|
|