Brummeline Braaten wrote:
How can I get the value of a inputhidden from the backingbean?
My jsp code is like this:
<h:column id="kategorikolonne">
<t:commandLink style="category_list" styleClass="category" id="kategorilink" action="#{tabnavigering.velgKategori}"> <t:outputText
value="#{rader.categoryName}" id="kategorinavn"/>                                
<t:inputHidden
value="#{rader.categoryId}" id="kategoriid"/>
</t:commandLink>                                                                  
</h:column>

When I click on the commandlink the method velgkategori is invoked. I would like
to find the kategoriid in my bean so that I can use it in other methods. How do
I do that?


Method rader.setCategoryId(newValue) will be called before your tabnavigering.velgKategoru method. If the tabnavigering bean has access to the rader bean then there is no problem.

If the tabnavigering class does not have easy access to the rader class then you could use this:

<t:commandLink action="#{tabnavigering.velgKategorei}" ...>
  <t:updateActionListener
    property="#{tabnavigering.categoryId}"
    value="#{rader.categoryId}"/>
</t:commandLink>

This should copy the categoryId value from the rader bean to the tabnavigering bean before calling the velgKategorei method. Or you could even do:
  <t:updateActionListener
    property="#{tabnavigering.rader}"
    value="#{rader}"/>


Regards,

Simon

Reply via email to