Thursday, May 29, 2008

Quick Comments

It is amazing. The more I work with the ADF and the surrounding technologies, the easier many things are becoming. I think it is wisdom to keep this in mind. For example, I wanted to have a master bullet list and a child af:table. I could not see a way to do it without putting the parent list in an af:table as well...so that is what I put it in.



A month later, I took another run at it; the problem I was having before is that to create the bulleted list I was using an af:forEach. There is no validation on each row like there is with an af:table on a submit. So if you want to set the current record, you cannot simply create a setCurrentRowWithKeyValue and pass it #{row.pkid} like you could with an af:table.



When taking another run at it, I first though of a complex thing I could do with binding, which might or might not have worked. I thought of an easier way of dealing with this problem in the meantime though: create an af:hiddenField with a ValueChangeListener that sets the current row. Then all you have to do is define the af:commandLinks you have in your bulleted list to have onclick defined to set the value of this hidden field to the value in the af:forEach. Something like the following:



document.getElementById("form1:hiddenfieldname").value = #{foreachRow.pkid};



Now you have your master!

No comments: