ユーザーが2つのオプションから選択できるようにしてから、これを使用しようとしています aset.add(MediaSizeName.ISO_A4);
ユーザーがa3とa4の間で選択するページがありますが、この変数を渡すことができませaset.add(MediaSizeName.variable);
ん.変数を使用してビットを変更しますか?cannot find symbol
public String paperSize;
.ISO
ありがとう
編集
<p:selectOneMenu value="#{printerSettings.paperSize}">
<f:selectItem itemValue="ISO_A5" itemLabel="A5" />
<f:selectItem itemValue="ISO_A4;" itemLabel="A4" />
<f:selectItem itemValue="ISO_A3" itemLabel="A3" />
</p:selectOneMenu>
上記は、ユーザーがサイズを選択する場所です
今、私は値を渡します:
<p:commandButton type="submit"
action="#{printInTen.countDown(printerSettings.t, printerSettings.p, printerSettings.paperSize)}"
onclick="Thankyou()" value="Print" />
そして値を渡そうとしていますpaperSize
public String paperSize;
public String orienation;
public void countDown(int t, int p, String paperSize) {
System.out.println("Now setting up attributes such as page size");
System.out.println ("Copies " + p);
aset.add(new Copies(p)); //having issues, will not work currently although code is fine// NOW WORKING :D
aset.add(MediaSizeName.paperSize);// will not let me use the variable here,
aset.add(Sides.DUPLEX);
aset.add(OrientationRequested.PORTRAIT);
しかし、何を試しても、渡す変数値 aset.add(MediaSizeName.paperSize);
はエラーで機能しませんcannot find symbol