Re: JavaScript not invoked on zone refresh

2018-09-25 Thread Christopher Dodunski
After exploring a little further, I discovered the below thread on
invoking javascript from within Tapestry.

https://stackoverflow.com/questions/27988473/pass-parameter-from-java-to-js-in-tapestry

Joost writes:

You will need to use the JavaScriptSupport service.

Your java file:

@Import(library = "RoomManagement.js")
public final class RoomManagement{

  @Inject
  private JavaScriptSupport javascriptSupport;

  @Property
  private long contactId;

  @AfterRender
  private void setup() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("contactId", contactId);
javascriptSupport.addInitializerCall("RoomManagement",jsonObject);
  }
}

Your RoomManagement.js

Tapestry.Initializer.RoomManagement = function (parameters) {
//do whatever you need here
alert('Your contactId: ' + parameters.contactId);
};

This looks promising, but I later read that Tapestry's handling of
javascript has been completely rewritten in Tapestry 5.4, with the above
being deprecated.  And I've not found any example code of doing tnings the
new way.  Any pointers would be much appreciated.

My page contains 10 expand/collapse buttons, and I only wish to animate
the one connected to the zone being updated.  So am thinking of giving
each button a unique ID, and passing that ID to the javascript so just the
one button animates.

My needs are pretty straight forward, and reportedly Tapestry's javascript
handling was completely rewritten in 5.4 to simplify things.  Look forward
to seeing how things now get done.  :-)

Appreciate any help.

Regards,

Chris.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Repository URL for 5.5-alpha releases

2018-09-25 Thread Balázs Palcsó
Hi,

What is the correct repository URL for 5.5-alpha releases?
This does not seem to contain them:
repositories {
maven {
url "https://repository.apache.org/content/groups/staging";
}
}

Many thanks,
Balazs


Re: JavaScript not invoked on zone refresh

2018-09-25 Thread Christopher Dodunski
Thanks Chung and Chris.

I doubt using .click() will work, as the button being clicked on is
immediately replaced, and it is this new button that must rotate.  The
buttons are for expanding and collpasing sections of a webpage.  Once a
user clicks on an expand button, it is immediately replaced with a
collapse button.  And vice versa.  Below is the TML:


















Chris, invoking my javascript within the page's Java code sounds
interesting.  I've not done this before, but will look into it.  Do you
have any sample code for this approach?

Thanks,

Chris.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org