Ayan Afridi

Greenhorn
+ Follow
since Jan 18, 2005
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 Ayan Afridi

Never mind. I have kept them in separate projects, but deploying through RAD doesnt work. I had to export my EAR file, and deploy it to the test server using the web admin console. That works fine, but deploying the projects through RAD does not work. Any idea why?
Hi,

I am developing a project which includes two mdb's as well as several non-ejb classes, which the MDB will call.
Do these classes need to specifically go into the same project (using rad 7.5) or can the MDB project reference my Web Project, where I want to put the classes invoked by the MDB?

Thanks,
Ayan
Yes, this is nested in a h:form tag.
14 years ago
JSF
I have a datatable with a bunch of h:inputText objects in it. This datatable is generated through a request scope backing bean's constructor. Basically, every time the constructor gets invoked, the datatable is constructed through code.

I also have a commandButton declared in the JSF page, with an action that points to a method in the same backing bean. When I debug this, and the "action" method is called, the list has not been updated w/the new data I entered.


I tried inserting rows into a DB using a datatable defined in the JSF page itself, and that works w/everything else the same. But I need this to work by generating the datatable through the backing bean. ANy idea what would be going on here?

Relevant code: this works when defined explicitly in the JSF page itself.

14 years ago
JSF
I am having a very strange problem in JSF. I currently have one links page with four commandLinks in it, and one JSF page witha datatable in it, and an IBM <hx:pagerDeluxe> in it to page through the data. Each command link fires off a different action, as shown below:

{code}<h:commandLink action="UM02">
<h:outputText value="UM02" />
</h:commandLink>
<h:commandLink action="UM03">
<h:outputText value="UM03" />
</h:commandLink>{code}
..........etc ........

My Navigation rules all point to one JSP file, but with a different param appended to the URL:
{code}
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>UM02</from-outcome>
<to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM02</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>UM03</from-outcome>
<to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM03</to-view-id>
</navigation-case>{code}

So as you can see, I have one JSF file to display a list from any given table name. I also dynamically populate the dataTable through my code, by reading through a list of columns for each table, and creating a "UIColumn":

{code}while( itr.hasNext() ){

String fieldName = (String) itr.next();
ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{var." + fieldName + "}");
HtmlOutputText header = new HtmlOutputText();
header.setValue(fieldName);
UIColumn col = new UIColumn();
UIOutput out = new UIOutput();
out.setValueBinding("value", vb);
col.setHeader( header );
col.getChildren().add(out);
dataTable.getChildren().add(col);
}{code}

And that dataTable is shown in the JSF page. So i can go back to the main links page, click on another table name, and it will populate the datatable with the correct columns, data, etc. The problem happens when I go to one table, say UM02, and hit ">" on the pager, to go to the next page, which works, THEN i go back to the links page, and hit "UM03" and the first page displays fine. When I try to go to the next page, I get an error saying that the backing bean UM03Bean does not have field "subProductCd". Basically, values from the old dataTable objects are being used for smoe reason when I page. Not sure why this is happening.

My datatable is defined like this:

{code}<h:form id="dataTableForm"><h:dataTable id="dataTable1" border="0" cellpadding="2"
cellspacing="0" columnClasses="columnClass1"
headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1, rowClass2, rowClass3"
styleClass="dataTableEx" width="70%" rows="10"
value="#{TestAction.list}" var="var"
binding="#{TestAction.listDataTableUI}">

<f:facet name="footer">
<hx:panelBox styleClass="panelBox" id="pagerbox">
<hx:pagerDeluxe styleClass="pagerDeluxe" id="deluxe1" for="dataTable1"/>
<h:commandLink action="home">
<h:outputText value="Back Home"></h:outputText>
</h:commandLink>
</hx:panelBox>

</f:facet>
</h:dataTable>
</h:form>
{code}
14 years ago
JSF
Hi,

I have a :selectManyListBox that is defined like this:




So as soon as a user clicks a reason, the criteriaSearchBean gets populated with the items selected, and the form is submitted.

The only problem is that this does not happen. The flowAdjustmentAction.criteriaSearchBean.reasonList does not get populated and is null. My syntax seems ok, because I am binding text boxes to other values in the criteriaSearchBean as well, and they dont get set to null.

The selectItems consist of an Object that is composed of an Integer , and a String. The array "reasonList" is an Integer array. There are no validation errors reported.
Anyone know what is up?

Thanks,
Ayan
15 years ago
JSF
Hi,

I have a h:datatable that has a checkbox in each row.
In the footer of the datatable, there is a button that "approves" all the selected rows (ie, it calls an action in the managed bean). If I select rows manually by checking off each checkbox, and then click "approve" - the action is fired everything is good.

Then I put in a "select all" checkbox, that selected all the showing checkboxes on the page. What the problem is, is that when I click approve now, no action is fired.

Any idea what is going on? I know this is a JSF forum - but here is the JS code:



Thanks,
Ayan
15 years ago
JSF
Never mind. this is the most stupid question I have ever asked. I had a problem with another tag on my page.

All good now.
15 years ago
JSF
Hi,

I have succesfully used h:dataTable to display a list of objects. But how would I display a simple list of strings in a datatable? Is this possible?
ex:
15 years ago
JSF
Hi,

I am using an HTMLDataTable as the model for my h:datatable on the frontend. I have implemented a selectManyListBox search functionality where as soon as the user clicks an item in any of the lists, the form is submitted, and only those rows which fit the selected criteria are shown. This is effectively a filter search.

The problem comes in when I have a datatable w/say 50 elements, and the size of my datatable is 20 elements. So when you click the ">" button, it goes to the last page.

Now I add a criteria selection, and now the amount of elements in the datatable is 18. Now there it can all fit in one page, but the datatable model needs to be set back to the first page. I am not sure how to do this... should I clarify?

Thanks,
Ayan
15 years ago
JSF
Hi,
I am using a selectManyListBox (lets call it list1) in a JSF page that has a valueChangeListener attached to it. So when I select some items from list1, and the form gets submitted automatically (using onchange="submit()"), my page reloads, but the scrolling position of the list1 is reset to the top.

Is there any way to override this behavior?

Thanks,
Ayan


See code below:

15 years ago
JSF
Never mind - I figured out the answer to my question. This is because the locale that is set to "en_us" - the default negative currency format is ($X.XX). makes sense.
15 years ago
JSF
I am having an issue with some currency conversion in dollars.
When I use the code below, negative currencies such as "-$24,0000.00" cannot be entered. They have to be entered as "($24,000.00)". Also, negative currencies are displayed with the parentheses when retrieved from the db.



Anyone know whats up?

-Ayan
15 years ago
JSF
As I said in the post - the "rendered" column for commandLink will display or not display the link for ALL the rows in the table. It will not conditionally display the link, row by row, as I showed above. Maybe I am using it incorrectly?

I showed How I am using it above.
15 years ago
JSF
I want to conditionally display a h:commandLink in a dataTable row, based on a column in the DB for that row.

So for example, say the dataTable consists of three rows:

Col1, Col2, Col3
Hi, 0, NO
Hello, 1, NO
Hi, 0, YES

<h:commandLink styleClass="columnCommandLink" id="link25" action="#{dosomething}" rendered="#{var.col3IsYES}" >
<h:outputText value=" [Delete]"></h:outputText>
</h:commandLink>

I only want the delete link to show for the third element, so the output would look like this

Col1, Col2, Col3
Hi 0 NO [update]
Hello 1 NO [update]
Hi 0 YES [update] | [delete]

I have tried the above method - it doesnt work - it will just display or not display delete for ALL rows.

Any ideas?

Thanks
Ayan
15 years ago
JSF