Hi List, 

I think I am stuck with a bug (B/) & I have a list-access element question as well. (below: A/)

A/ As you will probabely wonder with the code below: what is this guy trying to do with these value="#{regcalbean.currentEvent.refDateDeltas[2]}" ??!
Well, I have an ArrayList and I wondered whether there is a way to talking directly to an (Array -> indexed) element of this List. 
Like you can talk directly to an array index in Java. (that's where I stole the syntax) 
I get no complaints, but... the List just doens 't get filled so this must be wrong somehow :-)

I hope this is possible, if it is, a hint as to how to make this work is welcome! (I saw some methods smelling to what I want to do in a property resolver class, if I remember well, but I don't know how this translates into front-end access)

I know I can make it work by creating indirection-vars (one/list element) but that i sobviously far less elegant than if this direct access would be possible. (less memory, less redundancy, less code, ... and very intuitive)

B/ 
I think I came across a MyFaces-_javascript_ integration bugs (at least for 1.1.1 - donno whether it has already been mentioned or even better, corrected in 1.1.2!)

The error I got on several occasions, was a "element has no properties" error, whereas the element surely had props. 

Example 1:
 
To construct a (js-) popup with some explanantion, but taking into account internationalisation (hard req), I made a hidden text field holding the var for when the JS needed it. 
So in the page has this js: (header)

 function explainComplexData(){
var text = document.getElementById("justForJSPopup").value;
alert(text);}

& in the page itself: the img of a question mark which gives the explanation when clicked upon: 

<h:graphicImage value="../pics/regCalNew/questionHelp.png" />

& a hidden input field, just as a headless container for holding the explanantion in the correct language.
<h:inputHidden id="justForJSPopup"  value="#{labels.newCal_explainComplex}" />

This unfortunately does not work with MyFaces. (what made it work: change the inputHidden to a POHO (Plain Old HTML Object ;-) but then i18n goes thru the window and of course I prefer to stick to one compontent flavor)


Example 2: when checking a checkbox, 2 menus ("menu3" & "menu4" should change their "disabled"-aspect.)
Setup: one checkbox to trigger this, one js to apply these changes and of course the 2 selectMenus.
Code:

<h:selectBooleanCheckbox id="complexDeltaDateFlag" value="#{regcalbean.currentEvent.refDateDeltas[2]}" 
  />

<h:selectOneMenu value="#{regcalbean.currentEvent.refDateDeltas[4]}" id="menu4"> 
  <f:selectItem ... (a few selectItems) />
</h:selectOneMenu>

& the js:
function enableFocus()
{
if(document.getElementById('menu3').disabled == true)
{
document.getElementById('menu3').disabled = false; document.getElementById('menu4').disabled = false;
else {
document.getElementById('menu3').disabled = true;document.getElementById('menu4').disabled = true;
}
}

... gives same error: the elements (menu3 & menu4 here) would have "no properties"...


Frustrating!

Phil



Reply via email to