Srini Mutpur

Greenhorn
+ Follow
since Mar 29, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Srini Mutpur


1. I think you are facing checkbox and label alignment issue. The h:selectManyCheckBox will be converted to html table. Just check your css and adjust it properly for the alignment.
And also h:selectManyCheckBox has the properties like pageDirection, lineDirection, LTR etc. as per your requirement.

2. Yes, we need to use the String array has to value binded for h:selectManyCheckBox.

Thanks
Srini
14 years ago
JSF

The other option would be make an ajax call onclick on hyperlik and get the response and process it.
14 years ago
JSF


The selectOneRadio element will be binded to the boolean datatype variables.
Change the specialNeeds datatype to boolean from String.

Srini
14 years ago
JSF

All the special characters html numbers are available at

http://www.ascii.cl/htmlcodes.htm
http://www.degraeve.com/reference/specialcharacters.php

for >: >
for " : "

Thanks
Srini
14 years ago
JSF

Could please attach/post the multiSiteResearch.xhtml code ?
14 years ago
JSF

Have rerendered the submit Button panel ? I think rerendering of the submit button panel is not done.

Try to rerender the submit button panel on select box value change using <a4j:support reRender="panelId"/>.

Srini



14 years ago
JSF

We can work out this using some alternative approach.

Create invisible h:commandButton inside the same form and click it using javascript on hyperlink click event.

<h:commandButton id="VButton" action="#{managedBean.myAction}" style="display:none;"/>



function submitAction(){
document.getElementById('VButton').click();
}

Hope it may solve your problem.

Srini
14 years ago
JSF

Hi,

I would like to have input text element after every radio and radio elements are generated using h:selectOneRadio. Will it be possible ?

Please have look at the attached screen shot. It has three radio elements and three input text elements. I trying to have this input text element after every radio element.

Below is the code for the same.
Day
<h:selectOneRadio id="days">
<f:selectItem itemLabel="Sunday" itemValue="sun"></f:selectItem>
<f:selectItem itemLabel="Saturday" itemValue="sat"/>
<f:selectItem itemLabel="Friday" itemValue="fri"/>
</h:selectOneRadio>
T1: <h:inputText />
T2: <h:inputText />
T3: <h:inputText />

Please let me know if it is possible using h:selectOneRadio element ?

Thanks in advance.

Srini



14 years ago
JSF
I'm trying to write a javascript function, which opens the url in the new tab. Like

funtcion newTab(){
var url = "www.google.com";
----------
some code
----------
}

Whenever newTab() function is executed, google site should be open in the new tab of the same browser. Any ideas ?
Thanks in advance.

Srini
The onblur attribute sets the JavaScript code to execute when this element loses focus. It can not set the value in the backing bean.

What exactly you are trying to do ?Could you please provide some more information ?
14 years ago
JSF
Set the "User" manage property for the bean which wants to use the user bean. Say person bean wants to use the user bean
<managed-bean>
<managed-bean-name>Person</managed-bean-name>
<managed-bean-class>com.abc.domain.Person</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>user</property-name>
<value>#{User}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>User</managed-bean-name>
<managed-bean-class>com.abc.domain.User</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean> >
and also create the getter and setter for user in the person bean.
Person(){
com.abc.domain.User user;
// getter/setter for user
}
Note: user property name in the person bean and the managed property name should match.

Thanks
Srini
14 years ago
JSF

Are you using Rich faces, if yes you can <a4j:jsFunction> or other <a4j: > action mehtods so that you can update dynamically without refreshing the page.

Also, i am experiencing one more issue. If the click the Save button, the newly generated value is refreshed,i.e. it is cleared.
Does the newly generated value is mapped to any one of the bean property ?

Bind the each input text field with one bean property so that on form submit values will be updated to the bean and the values wont be cleared.

Hope it may solve your problem. Let me know if you have any confusion.

Thanks
Srini
14 years ago
JSF
MainMenuBean {

List<OrgBean> organiztions;
// getter for organizations
}

Class OrgBean(){

String orgTypeId;
String orgTypeDesc;
String orgType; // bind to the selectmanylist box value property

// getter & setters for all the properties
}

So now for each row in your datatable mapped to one orgBean object from the organizations list.

<h:dataTable id="stepTwoTable" value="#{mainMenuBean.organizations}" var="orgBean" >
<h:column>
<h:outputText rendered="#{orgBean.emptyListFlag}" value="#{orgBean.orgTypeDesc}" ></h:outputText>
</h:column>
<h:column>
<h:selectManyListbox rendered="#{orgBean.emptyListFlag}" id="orgList" value="#{orgBean.orgType}">
<f:selectItems value="#{orgBean.list}" />
</h:selectManyListbox>
</h:column>
</h:dataTable>

After form submit, all the values will be updated to respective bean properties.
In your action method iterate the organizations list and the value for the each row and sent it to business layer where it can update in the Database.

for(OrgBean obj: organizations){
String orgType = obj.getOrgType();
}


Please let me know if you have any confusion.

Thanks
Srini
14 years ago
JSF
Can you please tell me what's the datatype of MainMenuBean.organizations property ?

Assuming organiztions is list.
You can solve this as below.
1. Creae pojo class which contains the properties for orgTypeDesc(String), orgList(SelectItem List) and orgSelected(String).
2. Create objects and set the values from organizations list(the list which you are passing to datatable) and create Arraylist of the newly created class.
3. Use the updated arraylist for iterating the datatable.
4. Bind the select many list box value with orgSelected property of the newly created pojo class.
5. After form submit selected value in select manylist box will set to orgSelected property.
6. Iterate the updated arraylist to get to know the orgSelected property for each row.

Please let me know if you have any confusion.
14 years ago
JSF
Why you need onclick event... what exactly you are trying to do with the onclick javascript function... Could please elaborate ?
14 years ago
JSF