-
1. Re: rich:fileUpload with parameters and AllowFlash
mattdavies Sep 12, 2008 3:57 PM (in response to mattdavies)BTW the code used to retrieve the parameter is as follows:
String plid = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getParameter("plid");
TIA -
2. Re: rich:fileUpload with parameters and AllowFlash
shadowcreeper Sep 12, 2008 4:10 PM (in response to mattdavies)You could also use:
<a4j:support event="onuploadcomplete" reRender="printLocationsList" > <a4j:actionparam name="plid" value="#{entry.id}" assignTo="#{backingBean.requestingPlid}"/> </a4j:support>
Then you wouldn't need to jump through context hoops to get the parameter. -
3. Re: rich:fileUpload with parameters and AllowFlash
mattdavies Sep 12, 2008 5:16 PM (in response to mattdavies)Thanks. I have thought about something like this, but I worry about a race condition, however unlikely, that multiple uploads complete at the same time.
In my estimation what would be nice is to either dynamically set the ID with something like<rich:fileUpload id="i#{entry.id}" ...
but my understanding is the ID is set before the EL is completed so this cannot work.
or to fire off an action that, upon upload completion, would attach the plid to a hashmap with the entry.id as the key. -
4. Re: rich:fileUpload with parameters and AllowFlash
shadowcreeper Sep 12, 2008 5:35 PM (in response to mattdavies)So why not make your setRequestingPlid method just add an element to a list (no elements would be dropped -- synchronize if you want to) and reRender="#{bean.requestingPlids}"?
Have you tried attaching it to a hashmap (assignTo="#{bean.requestingPlids[entry.id]}")? Not sure what you are trying to use for the hashmap value though (some synchronizing may be required to make these safe)... -
5. Re: rich:fileUpload with parameters and AllowFlash
andrei_exadel Sep 15, 2008 4:35 AM (in response to mattdavies)Hi,
Yes. This issue was added to JIRA: https://jira.jboss.org/jira/browse/RF-4472.
Before it will be fixed please try to use hidden input as workaround to post parameter to server. -
6. Re: rich:fileUpload with parameters and AllowFlash
mattdavies Sep 16, 2008 2:59 PM (in response to mattdavies)Thanks,
That worked.
Here's what I did to fix it.<h:form> <rich:fileUpload ... /> <input type="hidden" name="plid" value="#{entry.id}" /> </h:form>