When I create a submit button on the form the following is generated in the HTML
XSP.attachEvent("view:_id1:_id2:_id38:_id55",
"view:_id1:_id2:_id38:button1", "onclick", null, true, 2);
});
"view:_id1:_id2:_id38:_id55" = the clientId of the eventHandler
"view:_id1:_id2:_id38:button1" = the button clientID (not at all confusing)
Much as I love the Portable Command Guide - I am unable to determine how I can programmatically get the eventHandler clientId.
I need the clientID to submit the form via ajax using the $$xspsubmitid field value
Can this be done through faces? and SSJS?
Reading deeper into what you want to do, I think taking a look at this article I wrote sometime back will give you deeper understanding of what is going on. The ID you are attempting to get, the clientId, rather than the targetClientId, is the id of the event handler, which you can get by assigning an id to, for example:
<xp:eventHandler id="foo">
that will force the runtime to use the specified ID rather than an auto-generated one, allowing you to get a handle on it.
getComponent("button1").getClientId(facesContext)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With